


/* ========================================== Edges is stored as Node of a linked list ========================================== */ public class Edge { int NodeID; // The neighbor node double Weight; // Weight of edge Node next; // Link variable } 
/* ============================================================= The graph is an array of Edge (Edge[i] = all edges of node i) ============================================================== */ public class Graph { public Edge[] graph; // Array of Edges } 


public class Graph { /* ======================================= The edges of the graph ======================================= */ double[][] M; // M[i][j] = weight of edge (i,j) ... } 