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.

35 lines
616 B

  1. #include "Vertex.h"
  2. Vertex::Vertex() {}
  3. Vertex::Vertex(const int &id) : m_id(id) {}
  4. VertexID Vertex::getID() const {
  5. return m_id;
  6. }
  7. std::vector<Arc> Vertex::getOutgoingArcs() const {
  8. return m_outgoing_arcs;
  9. }
  10. int Vertex::getLevel() const {
  11. return m_level;
  12. }
  13. bool Vertex::visited() const {
  14. return m_visited;
  15. }
  16. bool Vertex::hasDefinedLevel() const {
  17. return m_level != UNDEF_LEVEL;
  18. }
  19. void Vertex::addOutgoingArc(const Arc &arc) {
  20. m_outgoing_arcs.push_back(arc);
  21. }
  22. void Vertex::setLevel(const int &level) {
  23. m_level = level;
  24. }
  25. void Vertex::setVisited(const bool &visited) {
  26. m_visited = visited;
  27. }