Skip to content

Instantly share code, notes, and snippets.

View nithinivi's full-sized avatar
🎯
Focusing

निധിin nithinivi

🎯
Focusing
View GitHub Profile
@nithinivi
nithinivi / gist:d976bd666fb0a9c5da8a6a11f7e2d426
Created July 6, 2023 01:27 — forked from mvaz/gist:973464
Graph listener example
package net.mvaz.examples.graph;
import org.jgrapht.DirectedGraph;
import org.jgrapht.alg.DijkstraShortestPath;
import org.jgrapht.event.ConnectedComponentTraversalEvent;
import org.jgrapht.event.TraversalListenerAdapter;
import org.jgrapht.event.VertexTraversalEvent;
import org.jgrapht.graph.SimpleDirectedGraph;
import org.jgrapht.traverse.DepthFirstIterator;
import org.jgrapht.traverse.GraphIterator;