import org.jgrapht.*;
import org.jgrapht.graph.*;
public class Example {
// Cut down version of Job class
private static class Job {
private final int jobNumber;
private int jobTime;
你好,我一直在尋找在互聯網回答如何使無向圖中JGraphT,但它不工作,我有這樣的事情: g = new ListenableUndirectedGraph<String, MyEdge>(MyEdge.class);
graphAdapter = new JGraphXAdapter<String, MyEdge>(g);
g.addVertex("a");
g.addVertex("b
希望你做得很好! 我想編寫一個程序,我需要創建一個動態加權圖並獲得從一個頂點到另一個頂點的最短路徑。但在運行程序後,我得到這個異常: run:
TEST1
TEST Vertex Add
Exception in thread "main" java.lang.IllegalArgumentException: no such vertex in graph: 1
at org.jgrap