Project 2
Milestone1

Algorithms :

Perform temperature_schedule(alpha, ok, T0):
1. Return worth of temperature by (alpha * ok * T0)

Perform nearest_neighbour(ok,previous_sol) :
1. If previous_sol is zero, then compute the previous_sol
a. Choose one random path from G from supply to sink vertex and compute the stream of sink vertex by calling worth funciton and return the stream.
2. Else return previous_sol at all times

Perform worth(G):
1. Get the adjacency listing of graph G
2. Preliminary total_flow to zero
three. Iterate over the connectivity of vertex ‘t’
four. If any vertex v is related to vertex ‘t’ and path is in direction of ‘t’
5. Then
total_flow += stream from vertex ‘v’ to vertex ‘t’
6. Return the total_flow

Perform simulated_annealing():
1. Initialize the alpha to zero.98, T0 to 10000 , ok to 1, previous_sol to zero.
2. Assign the random values from 4000 to 10000 to every edges of the graph G
three. Get previous_sol by calling nearest_neighbour operate.
four. Whereas loop till T(alpha,ok,T0) > 1
a. Repeat:
i. Decide a path P from G from vertex ‘s’ to ‘t’ randomly.
ii. Change the worth on the sides of path P, by doing 3000 randomly
b. till no violation for capability.
c. Compute current_sol by calling worth funciton on G for path p.
d. Get previous_sol by calling nearest_neighbour operate
e. compute deltaE by current_sol – previous_sol
f. if deltaE is constructive, then current_sol is saved as previous_sol
g. else generate random worth between zero to 1, and compute e^(delta/T) if random is bigger, then save previous_sol as current_sol

Published by
Essays
View all posts