Skip to content
This repository was archived by the owner on Feb 29, 2024. It is now read-only.

Commit db8e926

Browse files
committed
order matters now
1 parent 8f56d9e commit db8e926

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dining.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public static void main(String[] args) throws IOException {
5757
graph.get(start-1).add(end-1);
5858
graph.get(end-1).add(start-1);
5959
cost.put(new Pair(start-1,end-1), edgeCost);
60+
cost.put(new Pair(end-1,start-1), edgeCost);
6061
}
6162
//System.out.println("Cost : "+cost);
6263
Map<Pair,Integer> costWithHaybales = new HashMap<>(cost);
@@ -87,6 +88,7 @@ public static void main(String[] args) throws IOException {
8788
//System.out.println("Dist: "+distOrig[target]+" Taste: "+taste[i]);
8889
//System.out.println(target+" -- "+(N-1) + " connected with weight "+(distOrig[target] - taste[i]));
8990
costWithHaybales.put(new Pair(target,N), distOrig[target] - taste[i]);
91+
//costWithHaybales.put(new Pair(N,target), distOrig[target] - taste[i]);
9092
}
9193
//System.out.println("Modified New Graph : "+graph);
9294
System.out.println("Cost : "+cost);

0 commit comments

Comments
 (0)