A simple students project implementing Dinic's Algorithm to compute the max flow/min cut of a network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
646 B

  1. #pragma once
  2. #include "Arc.h"
  3. #include "GraphParser.h"
  4. #define UNDEF_LEVEL -1
  5. class Vertex {
  6. public:
  7. Vertex();
  8. Vertex(const int &id);
  9. VertexID getID() const;
  10. std::vector<Arc> getOutgoingArcs() const;
  11. int getLevel() const;
  12. bool visited() const;
  13. bool hasDefinedLevel() const;
  14. void addOutgoingArc(const Arc &arc);
  15. void setLevel(const int &level);
  16. void setVisited(const bool &visited = true);
  17. private:
  18. VertexID m_id;
  19. int m_level;
  20. bool m_visited;
  21. std::vector<Arc> m_outgoing_arcs;
  22. };
  23. inline bool operator<(const Vertex& lhs, const Vertex& rhs) {
  24. return lhs.getID() < rhs.getID();
  25. }