Optimization Methods H. Rieger, Saarland University, Saarbrücken, Germany Summerschool on Computational Statistical Physics, 4.-11.8.2010 NCCU Taipei, Taiwan Optimization Task: Given a (discrete) configuration space C cost (or energy) function H on C Find: minxC H(x) E.g.: in statistical physics: Ground state of a classical system in business: shortest path, optimal tour (Traveling Salesman Problem – TSP), optimal work assignement, optimal network flow, … Stochastic optimization / Simulated Annealing Idea: Cost function = Energy H(a), a = configurations Boltzmann distribution for T0 is non-zero only for the state(s) with lowest energy E = E0 ( E1 E2 …): P(a) 0 for if H(a)>E0, and P(a) 1/M for if H(a)=E0, where M is the degeneracy of the ground state Hence if one can equilbrate a Monte-Carlo simulation for the system described by H at arbitrarily low temperatures T, the system will be exclusively in the ground state in the limit T0. Meta-code for Simulated Annealing: procedure Sim-Ann choose random initial configuration x set initial temperature T to T0 while ( T>Tfinal ) x‘ = x + random change if H(x‘) < H(x) x=x‘ else if (rand()<exp[ -(H(x)-H(x‘))/T ] ) x=x‘ T=nextT(T) output x The art lies in the definition of the temperature – or cooling - protocol nexT(T), Which is a function of the MC-time, the number of MC moves. Obviously, to successfully equilibrate the system for T0, the temperature has to be decreased very, very slowly … A simple combinatorial optimization problem: The (directed) polymer model: Non-directed Random bond energies: Total energy: ei [0,1] E i path ei Find ground state – i.e. optimal path From top node to a bottom nodes: Collection of optimal directed polymers directed Dijkstras algorithm for shortest paths in general graphs Start node: s Minimal distance (energy) from s to j: d(j) Predecessor of j: pred(j) algorithm Dijkstra begin S:={s}, S‘=N\{s}; d(s):=0, pred(s):=0; while |S|<|N| do begin choose (i,j): d(j):=mink,m{d(k)+ckm|k in S, m in S‘}; S‘=S‘\{j}; S=S+{j}; pred(j):=i; Performance O(N2), end with heap reshuffling O(N log(N)) end From one line to many lines Continuum model for N interacting elastic lines in a random potential 2 dri H dz Vrand [ri ( z ), z ] Vint [ri ( z ) rj ( z )] i 1 0 j ( i ) 2 dz N H Strong disorder: Vrand >> ; Vint short ranged, hard core H e n i i i ( bond ) Ground state of N-line problem: Minimum Cost Flow problem ni 0,1 ei [0,1] Example conf. for 9 lines: From one line to many lines (with hard-core interactions) s 3 1 3 3 -1 -1 1 3 -1 1 1 1 3 -1 3 3 1 -1 1 1 3 1 3 1 t Successive shortest path algorithm Successive shortest path algorithm Find successively shortest paths from s to t in the residual network Gr(n) (r = residual capacities): Use node potentials (i) reduced energies eij(n) all positive Use Dijkstra’s algorithm begin n:=0; (i)=0; Gr(n):=G; for line-counter = 1 to N do compute reduced energies eij(n)=eij + (i)- (j); find the shortest path distance d(i) from s to all other nodes i in the residual network Gr(n) w.r. to the reduced energies eij(n); increase flow on the shortest path from s to t by one unit; compute (i):=(i)-d(i); end end Successive shortest path algorithm (2) Details For details and applications see http://xxx.lanl.gov/abs/cond-mat/9705010 Another combinatorial optimization problem: Interfaces in random bond Ising ferromagnets H J ij Si S j J ij 0, Si 1 i Find for given random bonds Jij the ground state configuration {Si} with fixed +/- b.c. Si= +1 Find interface (cut) with minimum energy Si= -1 Min-Cut-Max-Flow Problem network G(V,A), arcs (Bonds) (i,j)A have capacity uij>0, flow 0<=nij<=uij fulfills mass balance constraint for i s v n n v for i t ji ij { j|( ji )A} { j|(ij )A} 0 else Find the maximum flow n* with value v from s to t residual network G(n) with residual capacities rij u ij nij n ji n* maximum flow no directed path st in G(n*) s-t cut [S,S‘] is a partition of V in two disjoint sets with sS, tS‘=V\S, (S,S‘) = {(i,j) A|i S,j S‘}; capacity of the s-t-cut vS , S ' (i , j )( S , S ') uij Min-Cut-Max-Flow-Theorem: max{n}v = min[S,S‘]v[S,S‘] and rij*=0 along (S,S‘) Augmenting path algorithm for max-flow For a flow x define the residual capacities: And the residual network G(x), consisting of edges with rij>0 Finding augmenting paths: Labeling algorithm Preflow-Push Algorithm Strategy: 1) flood the network from source 2) propagate the flooding toward the target 3) push excess flow back towards source excess flow e(i ) n ji { j |( ji ) A} n ij { j |( ij ) A} distance function d(i) (w.r.t. target) begin d(i) = exact distance from target, d(s)=|V| for all (s,j) A: nsj=usj; choose i V\{s,t} with e(i)>0 if there is (i,j) A with d(i)=d(j)+1: push =min{e(i),rij} flow units from i to j else relabel d(i)minj{d(j)+1|(i,j)A, rij>0}; end Preflow-PushAlgorithm (2) Interprete distance function (or labels) as height of the nodes. Problems that can be mapped on min-cut / max-flow • Interfaces / wetting in random media • Random field Ising model (in any dimension) • Periodic media (flux lines, CDW, etc.) in disordered environments • Elastic manifolds with periodic potential and disorder 2d spin glass (with free b.c.) with Jij random, of arbitrary sign! Thin lines: Jij>0, Thick lines: Jij<0 Set of unsatisfied edges is given by a set of paths from one frustrated plaquette to another (plus closed circles) Finding the ground state is a „minimum weighted perfect matching“ problem For details see http://xxx.lanl.gov/abs/cond-mat/9705010 Further applications of combinatorial optimization methods in Stat-Phys. o o o o o o o o o Flux lines with hard core interactions Vortex glass with strong screening Interfaces, elastic manifolds, periodic media Wetting phenomena in random systems Random field Ising systems Spin glasses (2d polynomial, d>2 NP complete) Statistical physics of complexity (K-Sat, vertex cover) Random bond Potts model at Tc in the limit q ∞ ...