WPFGraph is a tool to create animations of graph algorithms using a WPF based 3D rendering engine.
You can create a graph by adding nodes and edges to the UI simply by using your mouse.
Then you can execute a graph algorithm like Dijkstra on the created graph.
Additional information about the implementation can be found under
Watch a video of a sample animation:
- By clicking on an empty area, a new node is created
- By clicking on two nodes within one second (not necessarily different nodes), a new edge is created
- By clicking at a node or edge, its properties can be edited in the panel on the right
- All graph algorithms can be executed by selecting the corresponding entry in the menu
Implement custom graph algorithms
The application already contains several graph algorithms like Dijkstra or Kruskal. To create your own algorithms, add a new class to the solution and implement the interface
. After recompiling the solution, your algorithm will be listed in the menu.
Creating animations is quite simple, some extension methods make things even easier. In the following example, we add two nodes to the graph, then we flash the two nodes for 3 seconds. After the flashing is finished, both nodes are moved to another position.
public void Execute(IGraph<NodeData, EdgeData> graph)
this.node1 = graph.AddNode(new NodeData(new Point3D(0, 25, 0)));
this.node2 = graph.AddNode(new NodeData(new Point3D(0, -25, 0)));
private void Callback()
this.node1.Move(new Point3D(25, 0, 0), 4000);
this.node2.Move(new Point3D(-25, 0, 0), 4000);