# Warm start max flow

**URL:** <https://igraph.discourse.group/t/warm-start-max-flow/1393>\
**Category:** Usage\
**Tags:** Python\
**Created:** [21 October 2022 18:22 UTC](https://igraph.discourse.group/t/warm-start-max-flow/1393 "2022-10-21T18:22:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nparham](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/nparham/32/864_2.png) [@nparham](https://igraph.discourse.group/u/nparham)\
**Post date:** [21 October 2022 18:22 UTC](https://igraph.discourse.group/t/warm-start-max-flow/1393/1 "2022-10-21T18:22:12Z")

</div>

Is it possible to warm start the max flow in igraph?

I am currently solving max flows on a DAG iteratively and deleting nodes between iterations, but I would like to pass previous solutions if possible. I’m not sure if that would even speed things up, hoping for insight on that part too.

---

<div class="post-metadata">

**Author:** ![vtraag](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/vtraag/32/38_2.png) [@vtraag](https://igraph.discourse.group/u/vtraag)\
**Post date:** [21 October 2022 19:38 UTC](https://igraph.discourse.group/t/warm-start-max-flow/1393/2 "2022-10-21T19:38:01Z")

</div>

This is not possible in the current implementation. In principle it might be possible to implement something along those lines. However, this does not seem to be trivial in the current implementation.

Perhaps it would be easier to implement a specific maxflow algorithm for your purpose? I wouldn’t have any suggestions for particular algorithms that would best suit your needs though.

---

<div class="post-metadata">

**Author:** ![nparham](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/nparham/32/864_2.png) [@nparham](https://igraph.discourse.group/u/nparham)\
**Post date:** [26 March 2023 05:09 UTC](https://igraph.discourse.group/t/warm-start-max-flow/1393/3 "2023-03-26T05:09:46Z")

</div>

I’m a bit confused - I started looking back into this and I noticed that the C igraph documentation allows you to specify an initial flow input? [igraph Reference Manual](https://igraph.org/c/doc/igraph-Flows.html#maximum-flows)

---

<div class="post-metadata">

**Author:** ![GroteGnoom](https://yyz2.discourse-cdn.com/free1/user_avatar/igraph.discourse.group/grotegnoom/32/428_2.png) [@GroteGnoom](https://igraph.discourse.group/u/GroteGnoom)\
**Post date:** [26 March 2023 09:54 UTC](https://igraph.discourse.group/t/warm-start-max-flow/1393/4 "2023-03-26T09:54:02Z")

</div>

`igraph_vector_t *flow` is an output parameter, it’s used to pass the result back to the user. Even though it needs to be initialized, the input values are not used.
