RosettaCodeData/Task/Vogels-approximation-method/Zkl/vogels-approximation-method-2.zkl

15 lines
330 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
cols:=demand.keys.sort();
res :=vogel(costs,supply,demand);
cost:=0;
println("\t",cols.concat("\t"));
foreach g in (costs.keys.sort()){
print(g,"\t");
foreach n in (cols){
y:=res[g].find(n);
if(y){ y=y[0]; print(y); cost+=y*costs[g][n]; }
print("\t");
}
println();
}
println("\nTotal Cost = ",cost);