By analogy to statistical mechanics, microcanonical ensembles and canonical ensembles of networks are introduced for the implementation. A partition function Z of an ensemble can be defined as: Z = ∑ ∑ a δ δ [ F → → ( a ) − − C → → ] exp ⁡ ⁡ ( ∑ ∑ i j h i j Θ Θ ( a i j ) + r i j a i j )