I am writing sample programs for graph problems like Dijkstra or Bellman-Ford algorithms. In Dijkstra, for instance, when I input my program a set of vertices and edges, ask to find shortest path from Vertex A to Vertex B, my program currently outputs shortest path from A to B. I want to display graph and have a visualization of the output generated. Is there a way to display nodes and connecting lines? What C++ classes would help achieve this?
Check out qwt. It' a tool-set meant to compliment Qt.
Qt is a nice GUI creator. You can re-implement the paint function in QWidget to draw a widget in whatever way you like. qwt project will provide many different classes which inherit from QWidget. These are aimed at technical data representation such as graphing.
For what you want to do, it would be a complete overkill to try to learn to do it in C++. You can do it, and it isn't really difficult, but where you are there is a fairly steep learning curve before you can do very much useful.
I actually recommend you use Tcl/Tk instead. The Tk::canvas is exceedingly powerful and using it to draw stuff is astonishingly simple.