17 template <
class Node,
class Edge>
21 using adjacency_list = std::vector<std::pair<node_id, Edge>>;
23 virtual ~
graph() =
default;
29 virtual Node&
node(node_id
id);
30 virtual const Node&
node(node_id
id)
const;
43 virtual uint64_t
size()
const;
54 virtual node_id
insert(Node node) = 0;
60 template <
class... Args>
61 node_id
emplace(Args&&... args);
68 virtual void add_edge(Edge edge, node_id source, node_id dest) = 0;
75 virtual void add_edge(node_id source, node_id dest);
79 std::vector<std::pair<Node, adjacency_list>>
nodes_;
91 using std::runtime_error::runtime_error;