As a beginner in c++, I need to make an adjacency list graph. I want to generate a weighted graph that shows topology relations between planes and their angle as weight. So in the graph, planes represent graph vertices (e.g. v) and intersection lines represent graph edges (e.g. v1v2). Each intersection line has also one attribute. MY program generates such a txt file:
edge, attribute, weight
v1v2, 1, 90
v1v3, 2, 45
v1v3, 2, 30
v2v3, 3, 90
...
And here is the pseudo code that generates the txt file:
for (planes.begin, numberOFplanes, planei++){
for(planes.begin+1, numberOFplanes, planej++){
if (planei intersect planej){
cout << ViVj << attribute << angle << nedl;
}
}
}
I found below class from this link (Graph implementation C++) and want to implement in my code, but I do not know how to do it, more precise I need to give the plane numbers and their angle as input to the graph class to generate a graph.
p.s. I know the graph class from the link is a directed class and I don't mind to generate an undirected class, both or fine.