Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ALGO] Edmonds-Karp Algorithm for Maximum Flow #83

Closed
6 tasks
bobluppes opened this issue Aug 19, 2023 · 5 comments
Closed
6 tasks

[ALGO] Edmonds-Karp Algorithm for Maximum Flow #83

bobluppes opened this issue Aug 19, 2023 · 5 comments
Assignees
Labels
enhancement New feature help wanted Extra attention is needed no-issue-activity

Comments

@bobluppes
Copy link
Owner

bobluppes commented Aug 19, 2023

Edmonds-Karp Algorithm

The Edmonds-Karp algorithm is a greedy algorithm which computes the maximum flow in a flow network. See the wikipedia entry for a more detailed description.

It would be interesting to investigate if we can re-use the existing breadth_first_traverse method for the BFS part of the algorithm.

Syntax

The algorithm should have the following syntax:

/**
 * @brief Computes the maximum flow in a flow network using the Edmonds-Karp algorithm.
 * 
 * This algorithm finds the maximum flow in a flow network from a source vertex to a sink vertex.
 * 
 * @param graph The flow network graph.
 * @param source The source vertex.
 * @param sink The sink vertex.
 * @return The maximum flow value.
 */
template <typename V, typename E, typename WEIGHT_T = decltype(get_weight(std::declval<E>()))>
[[nodiscard]] WEIGHT_T edmonds_karp_max_flow(
    const graph<V, E, graph_type::DIRECTED>& graph,
    vertex_id_t source, vertex_id_t sink);

This should live in the graaf::algorithm namespace under include/graaflib/algorithm/maximum_flow.

Definition of Done

This issue is done when:

  • The algorithm is implemented
  • The new function has a javadoc-style comment explaining the interface
  • Appropriate tests are added under test/graaflib/algorithm/maximum_flow_test.cpp
  • A test coverage of at least 95% is reached
  • A documentation entry is added under docs/docs/algorithms under the appropriate category
    • Just adding a short description and the algorithm syntax here is fine
    • See the wiki on how to build the documentation locally
  • The algorithm is added to the list of algorithms in README.md
@bobluppes bobluppes added enhancement New feature help wanted Extra attention is needed good first issue Good for newcomers labels Aug 19, 2023
@ndcroos
Copy link
Contributor

ndcroos commented Aug 20, 2023

I'd like to do this after A* search. Can you assign it to me?

@bobluppes
Copy link
Owner Author

I'd like to do this after A* search. Can you assign it to me?

Hi, sorry for the late reply, of course! If you are still up for it I will assign it to you

@ndcroos
Copy link
Contributor

ndcroos commented Sep 22, 2023

Thanks for assigning it to me. I am still up for it and I have begun working on it. But it takes somewhat longer this time due to other duties.

@bobluppes bobluppes removed the good first issue Good for newcomers label Sep 30, 2023
@bobluppes
Copy link
Owner Author

Thanks for assigning it to me. I am still up for it and I have begun working on it. But it takes somewhat longer this time due to other duties.

No problem, thanks for the update :)

@github-actions
Copy link
Contributor

Stale issue message

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature help wanted Extra attention is needed no-issue-activity
Projects
None yet
Development

No branches or pull requests

2 participants