I need to implement some graph algorithms to solve a problem.
The problem involve making minimum spanning tree and all-pair-shortest-path graph from a given graph.
I never do graphs in C++ before so I have a few questions.
Should I build my graph data structures (vertices, edges..) from scratch using struct or something else? or is there a premade library that I an use(Hopefully there is and someone guide me to where I can learn about it)? My C++ experience is quite limited and I am doing lots of research to do this at the moment.
Also are vectors really superior over arrays? I found out that vectors can be expanded in size with much ease while arrays can not. Is there something else I am missing beside this advantage?
Vectors are far superior to arrays. The main advantage is you don't have to initialise them with a preset size. It takes a while to get used to how to iterate over them. You should do a bit of searching for graphs in the STL. I found the following site which might be of use to you:
boost has many add-on libraries for c++. Luckily for you, one of them is a Graph library. I can't paste a URL though because I don't have enough posts and there are some weird forum restrictions, so just google "c++ boost graph".
As for array vs. vector... array's are contiguous blocks of memory. That's all really. There are several STL containers built around arrays, such as vectors and lists and strings. You probably shouldn't be using array's until you understand what you are doing better, so just stick with vectors for now.
Or you could read up on the basics of data structures