From c1c9fbe72bb36c3a6d8bf27ff8e3fd60122dfe2c Mon Sep 17 00:00:00 2001 From: Kohei Morita Date: Fri, 7 Apr 2023 00:21:36 +0900 Subject: [PATCH] fix time complexty of maxflow --- document_en/maxflow.md | 5 +++-- document_ja/maxflow.md | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/document_en/maxflow.md b/document_en/maxflow.md index 950c0b8..214d967 100644 --- a/document_en/maxflow.md +++ b/document_en/maxflow.md @@ -55,8 +55,9 @@ It adds an edge oriented from the vertex `from` to the vertex `to` with the capa **@{keyword.complexity}** -- $O(\min(n^{\frac{2}{3}}m, m^{\frac{3}{2}}))$ (if all the capacities are $1$) or -- $O(n^2 m)$ (general), +- $O((n + m) \sqrt{m})$ (if all the capacities are $1$), +- $O(n^2 m)$ (general), or +- $O(F(n + m))$, where $F$ is the returned value where $m$ is the number of added edges. diff --git a/document_ja/maxflow.md b/document_ja/maxflow.md index a5cdc95..1e27b94 100644 --- a/document_ja/maxflow.md +++ b/document_ja/maxflow.md @@ -57,8 +57,9 @@ int graph.add_edge(int from, int to, Cap cap); $m$ を追加された辺数として -- $O(\min(n^{\frac{2}{3}}m, m^{\frac{3}{2}}))$ (辺の容量がすべて $1$ の時) +- $O((n + m) \sqrt{m})$ (辺の容量がすべて $1$ の時) - $O(n^2 m)$ +- 返り値を $F$ として $O(F(n + m))$ ## min_cut