15 using Edge=std::array<unsigned int,2>;
25 [[maybe_unused]]
explicit graph(
const std::string &file_name);
40 [[nodiscard]] std::vector<std::vector<unsigned int>>
get_node2nodes()
const;
55 return _vertices.size();
72 [[maybe_unused]]
bool Append(
unsigned int v1,
unsigned int v2);
81 [[maybe_unused]]
bool Delete(
unsigned int v1,
unsigned int v2);
88 bool Delete(Edge
const &e);
96 void Delete(std::vector<Edge>
const &v);
111 void DetermineNumberVertices();
113 std::vector<Edge> _edges;
114 std::set<unsigned int> _vertices;
115 unsigned int _maxvert;
graph & operator=(graph const &rhs)=default
size_t Max_vertex() const
void Delete(std::vector< Edge > const &v)
Removes the given edges from the graph. The method add only edges that not already contained in the g...
graph & operator=(graph &&rhs)=default
bool Delete(unsigned int v1, unsigned int v2)
Removes one directed edge (v1, v2) from the graph. The method add only edges that not already contain...
friend std::ostream & operator<<(std::ostream &s, graph const &rhs)
Prints edges and vertices of the graph.
graph(const std::string &file_name)
Reads edges for graph from file.
graph(graph &&org)=default
bool Append(unsigned int v1, unsigned int v2)
Appends one directed edge to the graph. The method add only edges that not already contained in the g...
graph(graph const &org)=default
std::vector< std::vector< unsigned int > > get_node2nodes() const