#ifndef C___WEIGHTEDGRAPH_H #define C___WEIGHTEDGRAPH_H #include #include #include struct Node { std::list> neighbours; Node() = default; Node(std::list> neighbours); void add_edge(int node_id, double weight); int deg() const; }; class WeightedGraph { public: WeightedGraph(size_t num_nodes); void add_edge(int from, int to, double weight); std::list> adjList(int node_id) const; size_t num_nodes() const; int num_edges() const; int deg(int v) const; std::pair min_neighbour(int node_id) const; WeightedGraph remove_parallel() const; private: std::vector nodes; int edges; }; #endif //C___WEIGHTEDGRAPH_H