Prim's Algorithm Visualizer built with C++ and SFML. This program has a simple keyboard/mouse event driven interface, which allows user to create any undirectional weighted graph and run algorithm visualization on it. In the end of the visualization, an graph will be replaces by produced MST. For more information about algorithm see: Prim's Algorithm
- You need to have SFML installed. In case you don't have it, follow this guide: SFML installation
- Clone this repository
- Navigate to the root of this repo
- Run
make. In case of any errors inspect theMakefileand configure it for your local environment - Navigate to
/bin/folder - run
./prims_visualizer
interaction with the program is carried out using keyboard and mouse:
- Press
Ato create vertex at mouse current position - Press
Xto remove vertex/edge at mouse current position - Press
0-9numbers to increase weight of an edge which is currently pointed by mouse - Press
Backspacedecrease weight of an edge which is currently pointed by mouse - Hold and drag
Mouse Right Buttonto create edge between 2 vertices - Hold and drag
Mouse Left Buttonto move a vertex - Hold and drag
Mouse Middle Buttonto move the canvas around - Press
Spaceto start Prim's algorithm animation

