Trade

Decision[] import;

for each(Kingdom in GetKingdomDictionary)

{


 * import = new Decision(Domain.RealNonnegative,"Imports"+kingdom.name);


 * model.AddDecision(import)


 * model.AddConstraints("Limit",0 <= import<= kingdom.supply)


 * model.AddGoal("cost", GoalKind.Minimize, travelDistanceCost*import);

}

model.AddDecisions(import[]);

Finding the best path for a trade route

allroute = new Decision[0]

for (int i = 0; i < city.length; i++)

{


 * if(i == 0)




 * }
 * cityroute = new Decision[city.length-1];


 * for(int j = 0; j < city.Length; j++)




 * if(i!=j)




 * cityroute[i] = model.AddDecision(Domain.Set(new int[]{0, bestPath(city[i],city[j]}) ,"route"+city[i]+city[j])
 * //cityroute[i] =  model.AddDecision(Domain.Set(new int[]{0, 1,"route"+city[i]+city[j])


 * }


 * }
 * //model.addconstraint(model.sum(route) = 1)


 * allroute.add(cityroute);

}

model.minimise(

//route[0,1,2,...route.length]*bestRoute(i,j))

https://msdn.microsoft.com/en-us/library/ff628587(v=vs.93).aspx

http://mat.gsia.cmu.edu/classes/QUANT/NOTES/chap5.pdf

https://nathanbrixius.wordpress.com/2010/04/26/traveling-salesman-problems-using-solver-foundation-c-code/

Google Optimiser download

https://developers.google.com/optimization/

Travelling salesman problem done with the google optimiser

https://developers.google.com/optimization/routing/tsp/tsp

Min Cost flow

https://developers.google.com/optimization/flow/mincostflow