1

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!

Oblivion
  • 7,176
  • 2
  • 14
  • 33
Peter
  • 59
  • 1
  • 9
  • This is the code, for some reason Stack Overflow does not allow me to post it because it is not formatted properly, sorry about that ! :) – Peter Sep 14 '19 at 11:43
  • #include using namespace lemon; int f(std::set > map, int n) { ListGraph graph; for (int i = 0; i < size; i++) { graph.addNode(); } return 0; } – Peter Sep 14 '19 at 11:43
  • Perhaps [this editing and formatting help](https://stackoverflow.com/editing-help) could be useful? – Some programmer dude Sep 14 '19 at 11:44

0 Answers0