I am trying to solve an algorithmic problem in C++ from my university, but it basically boils down to creating n*n graph with every node having edges to its neighbours ( basically something like a squared grid of connected nodes ). Then, I need to delete specific edges, and to run a shortest path algorithm ( for unweighted edges, I suppose lemon has this functionality ). My question is how to create such a graph, how to label an edge ( giving it a specific class, for example ), and how to delete edge between to nodes.
#include <lemon/list_graph.h>
using namespace lemon;
int f(std::set<std::pair<point, point> > map, int n) {
ListGraph graph;
for (int i = 0; i < size; i++) {
graph.addNode();
}
return 0;
}
Thank you very much!