#include <stdio.h>#include <stdlib.h>#include <string.h> #define INF 1000000#define MAXN 32 int N;int matrix[MAXN][MAXN]; int dist[MAXN];int path[MAXN];int s[MAXN]; void dijkstra(int u){ /* init */ int i, j, k; int min; int v
1.图类基本组成 存储在邻接表中的基本项 /** * Represents an edge in the graph * */ class Edge implements Comparable<Edge> { public Vertex dest; //Second vertex in Edge public double cost; //Edge cost public Edge(Vertex d, double c) { dest = d; cost = c; } @Override pu