diff --git a/Gvisual/src/gvisual/GraphFileParser.java b/Gvisual/src/gvisual/GraphFileParser.java index 3c43608..f8e06eb 100644 --- a/Gvisual/src/gvisual/GraphFileParser.java +++ b/Gvisual/src/gvisual/GraphFileParser.java @@ -164,6 +164,11 @@ public static ParseResult parse(String filePath, Predicate visibleFilter typeList.add(curEdge); } + // Ensure edge endpoints are tracked in the vertex set + // (they may not appear in the "nodes" section) + if (vertices.add(parts[1])) g.addVertex(parts[1]); + if (vertices.add(parts[2])) g.addVertex(parts[2]); + // Only add to graph if this type is visible if (visibleFilter.test(parts[0])) { g.addEdge(curEdge, parts[1], parts[2]);