#ifndef C___DIGRAPH_H #define C___DIGRAPH_H #include #include #include struct Node { std::list neighbours; Node() = default; Node(std::list neighbours); void add_edge(int v); }; class Digraph { public: Digraph(size_t num_nodes); void add_edge(int from, int to); std::list adjList(int node_id) const; size_t num_nodes() const; Digraph transpose() const; bool isEdge(int from, int to) const; private: std::vector nodes; }; #endif //C___DIGRAPH_H