  We propose a method to find out the community structure of a complex network.
In this method the ground state problem of a ferromagnetic random field Ising
model is considered on the network with the magnetic field $B_s = +\infty$,
$B_{t} = -\infty$, and $B_{i\neq s,t}=0$ for a node pair $s$ and $t$. The
ground state problem is equivalent to the so-called maximum flow problem, which
can be solved exactly numerically with the help of a combinatorial optimization
algorithm. The community structure is then identified from the ground state
Ising spin domains for all pairs of $s$ and $t$. Our method provides a
criterion for the existence of the community structure, and is applicable to
unweighted and weighted networks equally well. We demonstrate the performance
of the method by applying it to the Barab\'asi-Albert network, Zachary karate
club network, the scientific collaboration network, and the stock price
correlation network.
