From a4ac368711ddb0940b069e91847c128baa980bba Mon Sep 17 00:00:00 2001 From: Taichi Yamakawa Date: Thu, 6 May 2021 17:50:14 +0900 Subject: [PATCH 1/8] Redesign APIs of bipartite maximum matching --- .../graph/bipartite-maximum-matching.hpp | 78 +++++++++++-------- .../graph/main-bipartite-maximum-matching.cpp | 18 ++--- 2 files changed, 51 insertions(+), 45 deletions(-) diff --git a/lib/cpalgo/graph/bipartite-maximum-matching.hpp b/lib/cpalgo/graph/bipartite-maximum-matching.hpp index bb7abea4..9650a198 100644 --- a/lib/cpalgo/graph/bipartite-maximum-matching.hpp +++ b/lib/cpalgo/graph/bipartite-maximum-matching.hpp @@ -1,56 +1,66 @@ #pragma once -// Verified -// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_7_A - +#include #include // Bipartite Maximum Matching -// Memory: O(V + E) -// NOTE: undirected, bipartite +// +// Space: O(V + E) +// +// NOTE: +// - undirected +// - bipartite +// +// Verified: +// - http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_7_A +// class BipartiteMaximumMatching { - int N; - std::vector> adj; - // Temporal - std::vector match; - std::vector used; + size_t N; + std::vector> adj; public: - // O(N) - BipartiteMaximumMatching(int n = 0): N(n), adj(n) {} - // O(1) - int size() { + // Time: O(N) + BipartiteMaximumMatching(size_t n = 0) + : N(n) + , adj(n) + { + // Do nothing + } + // Time: O(1) + size_t size() const { return N; } - // O(1) - void add_edge(int u, int v) { - throw_if_invalid_index(u); - throw_if_invalid_index(v); + // u = [0,N), v = [0,N) + // Time: O(1) + void add_edge(size_t u, size_t v) { + if (u >= N) throw std::out_of_range("u"); + if (v >= N) throw std::out_of_range("v"); adj[u].push_back(v); adj[v].push_back(u); } - // O(V(V+E)) - int solve(std::vector& out_match) { - int ans = 0; - match.assign(N, -1); - for (int v = 0; v < N; ++v) { - if (match[v] != -1) continue; + // Time: O( V(V+E) ) + size_t solve(std::vector& match) const { + size_t ans = 0; + std::vector used(N, false); + match = std::vector(N, N); + for (size_t v = 0; v < N; ++v) { + if (match[v] != N) continue; used.assign(N, false); - if (dfs(v)) ans++; + if (dfs(match, used, v)) ans++; } - out_match = std::vector(match); return ans; } private: - void throw_if_invalid_index(int index) { - if (index < 0 || index >= N) throw "index out of range"; - } - bool dfs(int v) { + bool dfs( + std::vector& match, + std::vector& used, + size_t v + ) const { used[v] = true; - for (int u : adj[v]) { - int w = match[u]; - if (w == -1 || (!used[w] && dfs(w))) { + for (size_t u : adj[v]) { + size_t w = match[u]; + if (w == N || (!used[w] && dfs(match, used, w))) { match[v] = u; match[u] = v; return true; @@ -58,4 +68,4 @@ class BipartiteMaximumMatching { } return false; } -}; \ No newline at end of file +}; diff --git a/lib/main/graph/main-bipartite-maximum-matching.cpp b/lib/main/graph/main-bipartite-maximum-matching.cpp index 61619287..fb3f06e9 100644 --- a/lib/main/graph/main-bipartite-maximum-matching.cpp +++ b/lib/main/graph/main-bipartite-maximum-matching.cpp @@ -7,21 +7,17 @@ using namespace std; BipartiteMaximumMatching solver; void action_init() { - int size; + size_t size; cin >> size; - if (size < 0) { - cout << "false" << endl; - return; - } solver = BipartiteMaximumMatching(size); cout << "true" << endl; } void action_edge() { - int u, v; + size_t u, v; cin >> u >> v; - if (u < 0 || u >= solver.size() || - v < 0 || v >= solver.size()) + if (u >= solver.size() || + v >= solver.size()) { cout << "false" << endl; return; @@ -31,10 +27,10 @@ void action_edge() { } void action_solve() { - vector match; - int ans = solver.solve(match); + vector match; + size_t ans = solver.solve(match); cout << ans << endl; - for (int i = 0; i < match.size(); ++i) { + for (size_t i = 0; i < match.size(); ++i) { cout << i << ": " << match[i] << endl; } } From 3720d1efb426fc8a96ded36156e9f409a87a2cc6 Mon Sep 17 00:00:00 2001 From: Taichi Yamakawa Date: Thu, 6 May 2021 18:42:10 +0900 Subject: [PATCH 2/8] Redesign APIs of bipartite check --- lib/cpalgo/graph/bipartite-check.hpp | 62 ++++++++++++++----------- lib/main/graph/main-bipartite-check.cpp | 12 ++--- 2 files changed, 40 insertions(+), 34 deletions(-) diff --git a/lib/cpalgo/graph/bipartite-check.hpp b/lib/cpalgo/graph/bipartite-check.hpp index 62d8ab8c..ab23aa4b 100644 --- a/lib/cpalgo/graph/bipartite-check.hpp +++ b/lib/cpalgo/graph/bipartite-check.hpp @@ -1,42 +1,57 @@ #pragma once -#include #include +#include +#include + // Bipartite Check +// // Memory: O(V + E) -// NOTE: undirected, no-multi-edge, self-loop +// +// NOTE: +// - undirected +// - no-multi-edge +// - self-loop +// class BipartiteCheck { - int N; - std::vector> adj; + size_t N; + std::vector> adj; public: - // O(V) - BipartiteCheck(int n = 0): N(n), adj(n) {} - // O(1) - int size() { + // Time: O(V) + BipartiteCheck(size_t n = 0) + : N(n) + , adj(n) + { + // Do nothing + } + // Time: O(1) + size_t size() const { return N; } - // O(1) - void add_edge(int u, int v) { - throw_if_invalid_index(u); - throw_if_invalid_index(v); + // u = [0,N), v = [0,N) + // Time: O(1) + void add_edge(size_t u, size_t v) { + if (u >= N) throw std::out_of_range("u"); + if (v >= N) throw std::out_of_range("v"); adj[u].push_back(v); adj[v].push_back(u); } - // O(V) - bool solve() { + // Time: O(V) + bool solve() const { bool is_bipartite = true; - std::vector side(N, -1); - std::queue Q; - for (int i = 0; i < N; ++i) { - if (side[i] != -1) continue; + int const UNKNOWN = 2; + std::vector side(N, UNKNOWN); + std::queue Q; + for (size_t i = 0; i < N; ++i) { + if (side[i] != UNKNOWN) continue; Q.push(i); side[i] = 0; while (Q.size()) { - int v = Q.front(); Q.pop(); - for (int u : adj[v]) { - if (side[u] == -1) { + auto v = Q.front(); Q.pop(); + for (auto u : adj[v]) { + if (side[u] == UNKNOWN) { side[u] = side[v] ^ 1; Q.push(u); } else { @@ -47,9 +62,4 @@ class BipartiteCheck { } return is_bipartite; } - -private: - void throw_if_invalid_index(int index) { - if (index < 0 || index >= N) throw "index out of range"; - } }; \ No newline at end of file diff --git a/lib/main/graph/main-bipartite-check.cpp b/lib/main/graph/main-bipartite-check.cpp index 26a14b9c..14980200 100644 --- a/lib/main/graph/main-bipartite-check.cpp +++ b/lib/main/graph/main-bipartite-check.cpp @@ -7,21 +7,17 @@ using namespace std; BipartiteCheck solver; void action_init() { - int size; + size_t size; cin >> size; - if (size < 0) { - cout << "false" << endl; - return; - } solver = BipartiteCheck(size); cout << "true" << endl; } void action_add_edge() { - int u, v; + size_t u, v; cin >> u >> v; - if (u < 0 || u >= solver.size() || - v < 0 || v >= solver.size() + if (u >= solver.size() || + v >= solver.size() ) { cout << "false" << endl; return; From c756d82b10ccc9db82bf51ae6a75543878e2dfad Mon Sep 17 00:00:00 2001 From: Taichi Yamakawa Date: Thu, 6 May 2021 18:46:05 +0900 Subject: [PATCH 3/8] Organize files of bipartite features --- .../bipartite_check.hpp} | 0 .../bipartite_maximum_matching.hpp} | 0 lib/main/graph/BUILD | 14 -------------- lib/main/graph/bipartite/BUILD | 17 +++++++++++++++++ .../{ => bipartite}/main-bipartite-check.cpp | 2 +- .../main-bipartite-maximum-matching.cpp | 2 +- 6 files changed, 19 insertions(+), 16 deletions(-) rename lib/cpalgo/graph/{bipartite-check.hpp => bipartite/bipartite_check.hpp} (100%) rename lib/cpalgo/graph/{bipartite-maximum-matching.hpp => bipartite/bipartite_maximum_matching.hpp} (100%) create mode 100644 lib/main/graph/bipartite/BUILD rename lib/main/graph/{ => bipartite}/main-bipartite-check.cpp (93%) rename lib/main/graph/{ => bipartite}/main-bipartite-maximum-matching.cpp (93%) diff --git a/lib/cpalgo/graph/bipartite-check.hpp b/lib/cpalgo/graph/bipartite/bipartite_check.hpp similarity index 100% rename from lib/cpalgo/graph/bipartite-check.hpp rename to lib/cpalgo/graph/bipartite/bipartite_check.hpp diff --git a/lib/cpalgo/graph/bipartite-maximum-matching.hpp b/lib/cpalgo/graph/bipartite/bipartite_maximum_matching.hpp similarity index 100% rename from lib/cpalgo/graph/bipartite-maximum-matching.hpp rename to lib/cpalgo/graph/bipartite/bipartite_maximum_matching.hpp diff --git a/lib/main/graph/BUILD b/lib/main/graph/BUILD index 28d7cd4f..40eb0a9d 100644 --- a/lib/main/graph/BUILD +++ b/lib/main/graph/BUILD @@ -9,20 +9,6 @@ cc_binary( deps = DEPS, ) -cc_binary( - name = "bipartite-check", - srcs = ["main-bipartite-check.cpp"], - copts = COPTS, - deps = DEPS, -) - -cc_binary( - name = "bipartite-maximum-matching", - srcs = ["main-bipartite-maximum-matching.cpp"], - copts = COPTS, - deps = DEPS, -) - cc_binary( name = "bridges", srcs = ["main-bridges.cpp"], diff --git a/lib/main/graph/bipartite/BUILD b/lib/main/graph/bipartite/BUILD new file mode 100644 index 00000000..c4370022 --- /dev/null +++ b/lib/main/graph/bipartite/BUILD @@ -0,0 +1,17 @@ +load("@rules_cc//cc:defs.bzl", "cc_binary") +load("//:variables.bzl", "COPTS") +load("//main:variables.bzl", "DEPS") + +cc_binary( + name = "bipartite-check", + srcs = ["main-bipartite-check.cpp"], + copts = COPTS, + deps = DEPS, +) + +cc_binary( + name = "bipartite-maximum-matching", + srcs = ["main-bipartite-maximum-matching.cpp"], + copts = COPTS, + deps = DEPS, +) diff --git a/lib/main/graph/main-bipartite-check.cpp b/lib/main/graph/bipartite/main-bipartite-check.cpp similarity index 93% rename from lib/main/graph/main-bipartite-check.cpp rename to lib/main/graph/bipartite/main-bipartite-check.cpp index 14980200..a1061ac1 100644 --- a/lib/main/graph/main-bipartite-check.cpp +++ b/lib/main/graph/bipartite/main-bipartite-check.cpp @@ -1,6 +1,6 @@ #include #include "template/template-main.hpp" -#include "cpalgo/graph/bipartite-check.hpp" +#include "cpalgo/graph/bipartite/bipartite_check.hpp" using namespace std; diff --git a/lib/main/graph/main-bipartite-maximum-matching.cpp b/lib/main/graph/bipartite/main-bipartite-maximum-matching.cpp similarity index 93% rename from lib/main/graph/main-bipartite-maximum-matching.cpp rename to lib/main/graph/bipartite/main-bipartite-maximum-matching.cpp index fb3f06e9..8878ff6d 100644 --- a/lib/main/graph/main-bipartite-maximum-matching.cpp +++ b/lib/main/graph/bipartite/main-bipartite-maximum-matching.cpp @@ -1,6 +1,6 @@ #include #include "template/template-main.hpp" -#include "cpalgo/graph/bipartite-maximum-matching.hpp" +#include "cpalgo/graph/bipartite/bipartite_maximum_matching.hpp" using namespace std; From bfe31624132b3accde11f692d46a652e141b8ec7 Mon Sep 17 00:00:00 2001 From: Taichi Yamakawa Date: Thu, 6 May 2021 18:06:02 +0900 Subject: [PATCH 4/8] Revise docs --- lib/cpalgo/graph/README.md | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/cpalgo/graph/README.md b/lib/cpalgo/graph/README.md index 6bc8ff9a..d6a9bca4 100644 --- a/lib/cpalgo/graph/README.md +++ b/lib/cpalgo/graph/README.md @@ -58,10 +58,25 @@ We can find all articulation points of a given graph in `O(V + E)`. ## Bipartite ### Bipartite Check -🚧 +Check whether a given graph is bipartite or not. +It can be computed in `O(V)`. +`V` is the number of vertices. + +[Bipartite Check | C++ code](bipartite/bipartite_check.hpp) ### Bipartite Maximum Matching -🚧 +Find the maximum matching in a given bipartite graph `G`. +Kuhn's algorithm can compute the maximum matching in `O(VE)`. +`V` is the number of vertices. `E` is the number of edges. + +[Bipartite Maximum Matching | C++ code](bipartite/bipartite_maximum_matching.hpp) + +#### References in English +- [Kuhn's Algorithm for Maximum Bipartite Matching - Competitive Programming Algorithms](https://cp-algorithms.com/graph/kuhn_maximum_bipartite_matching.html) + +#### Challenges +- [GRL_7_A < Problems | Aizu Online Judge](https://onlinejudge.u-aizu.ac.jp/problems/GRL_7_A) +- [C - 2D Plane 2N Points](https://atcoder.jp/contests/abc091/tasks/arc092_a) ## Cycle From 9c24f4f8fbd921b8d4e0d1067b68dd4eb459f475 Mon Sep 17 00:00:00 2001 From: Taichi Yamakawa Date: Thu, 6 May 2021 18:54:20 +0900 Subject: [PATCH 5/8] aoj/GRL7A --- aoj/GRL/GRL7A/main.cpp | 74 ++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 35 deletions(-) diff --git a/aoj/GRL/GRL7A/main.cpp b/aoj/GRL/GRL7A/main.cpp index 50904252..2fbf6f49 100644 --- a/aoj/GRL/GRL7A/main.cpp +++ b/aoj/GRL/GRL7A/main.cpp @@ -1,51 +1,55 @@ -#include +// https://onlinejudge.u-aizu.ac.jp/problems/GRL_7_A + +#include + -// Bipartite Maximum Matching -// Memory: O(V + E) -// NOTE: undirected, bipartite class BipartiteMaximumMatching { - int N; - std::vector> adj; - // Temporal - std::vector match; - std::vector used; + size_t N; + std::vector> adj; public: - // O(N) - BipartiteMaximumMatching(int n = 0): N(n), adj(n) {} - // O(1) - int size() { + // Time: O(N) + BipartiteMaximumMatching(size_t n = 0) + : N(n) + , adj(n) + { + // Do nothing + } + // Time: O(1) + size_t size() const { return N; } - // O(1) - void add_edge(int u, int v) { - throw_if_invalid_index(u); - throw_if_invalid_index(v); + // u = [0,N), v = [0,N) + // Time: O(1) + void add_edge(size_t u, size_t v) { + if (u >= N) throw std::out_of_range("u"); + if (v >= N) throw std::out_of_range("v"); adj[u].push_back(v); adj[v].push_back(u); } - // O(V(V+E)) - int solve(std::vector& out_match) { - int ans = 0; - match.assign(N, -1); - for (int v = 0; v < N; ++v) { - if (match[v] != -1) continue; + // Time: O( V(V+E) ) + size_t solve(std::vector& match) const { + size_t ans = 0; + std::vector used(N, false); + match = std::vector(N, N); + for (size_t v = 0; v < N; ++v) { + if (match[v] != N) continue; used.assign(N, false); - if (dfs(v)) ans++; + if (dfs(match, used, v)) ans++; } - out_match = std::vector(match); return ans; } private: - void throw_if_invalid_index(int index) { - if (index < 0 || index >= N) throw "index out of range"; - } - bool dfs(int v) { + bool dfs( + std::vector& match, + std::vector& used, + size_t v + ) const { used[v] = true; - for (int u : adj[v]) { - int w = match[u]; - if (w == -1 || (!used[w] && dfs(w))) { + for (size_t u : adj[v]) { + size_t w = match[u]; + if (w == N || (!used[w] && dfs(match, used, w))) { match[v] = u; match[u] = v; return true; @@ -56,9 +60,9 @@ class BipartiteMaximumMatching { }; -#include - using namespace std; +using ll = int64_t; +using ff = long double; int main() { ios_base::sync_with_stdio(false); @@ -74,7 +78,7 @@ int main() { matching.add_edge(x, y + X); } - vector match; + vector match; int ans = matching.solve(match); cout << ans << endl; From fe584a9b53bdb051d2424da1d759342f9035f6da Mon Sep 17 00:00:00 2001 From: Taichi Yamakawa Date: Thu, 6 May 2021 18:54:31 +0900 Subject: [PATCH 6/8] Verify bipartite_maximum_matching --- lib/cpalgo/graph/bipartite/bipartite_maximum_matching.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cpalgo/graph/bipartite/bipartite_maximum_matching.hpp b/lib/cpalgo/graph/bipartite/bipartite_maximum_matching.hpp index 9650a198..c6906502 100644 --- a/lib/cpalgo/graph/bipartite/bipartite_maximum_matching.hpp +++ b/lib/cpalgo/graph/bipartite/bipartite_maximum_matching.hpp @@ -12,7 +12,7 @@ // - bipartite // // Verified: -// - http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_7_A +// - https://onlinejudge.u-aizu.ac.jp/problems/GRL_7_A // class BipartiteMaximumMatching { size_t N; From 8e89d50fb1722d4190b7a8c134f9e16d0dcbd113 Mon Sep 17 00:00:00 2001 From: Taichi Yamakawa Date: Thu, 6 May 2021 21:19:34 +0900 Subject: [PATCH 7/8] Add tests of Bipartite Maximum Matching --- .../tests/bipartite_maximum_matching_test.cpp | 38 ++++++ ...tite_maximum_matching_testcase1.drawio.svg | 120 ++++++++++++++++++ 2 files changed, 158 insertions(+) create mode 100644 lib/cpalgo/graph/bipartite/tests/bipartite_maximum_matching_test.cpp create mode 100644 lib/cpalgo/graph/bipartite/tests/bipartite_maximum_matching_testcase1.drawio.svg diff --git a/lib/cpalgo/graph/bipartite/tests/bipartite_maximum_matching_test.cpp b/lib/cpalgo/graph/bipartite/tests/bipartite_maximum_matching_test.cpp new file mode 100644 index 00000000..2cff3ded --- /dev/null +++ b/lib/cpalgo/graph/bipartite/tests/bipartite_maximum_matching_test.cpp @@ -0,0 +1,38 @@ +#include +#include "gtest/gtest.h" +#include "cpalgo/graph/bipartite/bipartite_maximum_matching.hpp" + +using namespace std; + + +TEST(BipartiteMaximumMatchingTest, IsEmptyInitially) { + + BipartiteMaximumMatching solver; + EXPECT_EQ(0ULL, solver.size()); + +} + +TEST(BipartiteMaximumMatchingTest, ShouldComputeInCase1) { + + size_t const N = 7; + BipartiteMaximumMatching solver(N); + + // bipartite_maximum_matching_testcase1 + solver.add_edge(0, 1); + solver.add_edge(2, 1); + solver.add_edge(2, 3); + solver.add_edge(2, 5); + solver.add_edge(4, 3); + + vector match; + auto num_match = solver.solve(match); + EXPECT_EQ(num_match, size_t(3)); + EXPECT_EQ(match[0], size_t(1)); + EXPECT_EQ(match[1], size_t(0)); + EXPECT_EQ(match[2], size_t(5)); + EXPECT_EQ(match[3], size_t(4)); + EXPECT_EQ(match[4], size_t(3)); + EXPECT_EQ(match[5], size_t(2)); + EXPECT_EQ(match[6], size_t(7)); + +} \ No newline at end of file diff --git a/lib/cpalgo/graph/bipartite/tests/bipartite_maximum_matching_testcase1.drawio.svg b/lib/cpalgo/graph/bipartite/tests/bipartite_maximum_matching_testcase1.drawio.svg new file mode 100644 index 00000000..97c05c38 --- /dev/null +++ b/lib/cpalgo/graph/bipartite/tests/bipartite_maximum_matching_testcase1.drawio.svg @@ -0,0 +1,120 @@ + + + + + + + +
+
+
+ 0 +
+
+
+
+ + 0 + +
+
+ + + + +
+
+
+ 1 +
+
+
+
+ + 1 + +
+
+ + + + +
+
+
+ 3 +
+
+
+
+ + 3 + +
+
+ + + + + +
+
+
+ 5 +
+
+
+
+ + 5 + +
+
+ + + + +
+
+
+ 2 +
+
+
+
+ + 2 + +
+
+ + + + +
+
+
+ 4 +
+
+
+
+ + 4 + +
+
+ + + + +
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file From 32e9422107c98a180732a11aae3a4dd5af06c1da Mon Sep 17 00:00:00 2001 From: Taichi Yamakawa Date: Thu, 6 May 2021 21:26:17 +0900 Subject: [PATCH 8/8] Add tests of Bipartite Check --- .../bipartite/tests/bipartite_check_test.cpp | 46 ++++++++ .../bipartite_check_testcase1.drawio.svg | 103 +++++++++++++++++ .../bipartite_check_testcase2.drawio.svg | 104 ++++++++++++++++++ 3 files changed, 253 insertions(+) create mode 100644 lib/cpalgo/graph/bipartite/tests/bipartite_check_test.cpp create mode 100644 lib/cpalgo/graph/bipartite/tests/bipartite_check_testcase1.drawio.svg create mode 100644 lib/cpalgo/graph/bipartite/tests/bipartite_check_testcase2.drawio.svg diff --git a/lib/cpalgo/graph/bipartite/tests/bipartite_check_test.cpp b/lib/cpalgo/graph/bipartite/tests/bipartite_check_test.cpp new file mode 100644 index 00000000..94c23174 --- /dev/null +++ b/lib/cpalgo/graph/bipartite/tests/bipartite_check_test.cpp @@ -0,0 +1,46 @@ +#include +#include "gtest/gtest.h" +#include "cpalgo/graph/bipartite/bipartite_check.hpp" + +using namespace std; + + +TEST(BipartiteCheckTest, IsEmptyInitially) { + + BipartiteCheck solver; + EXPECT_EQ(0ULL, solver.size()); + +} + +TEST(BipartiteCheckTest, ShouldPassBipartite) { + + size_t const N = 6; + BipartiteCheck solver(N); + + // bipartite_check_testcase1 + solver.add_edge(0, 1); + solver.add_edge(0, 5); + solver.add_edge(2, 1); + solver.add_edge(2, 3); + solver.add_edge(2, 5); + + EXPECT_TRUE(solver.solve()); + +} + +TEST(BipartiteCheckTest, ShouldRejectNonBipartite) { + + size_t const N = 6; + BipartiteCheck solver(N); + + // bipartite_check_testcase3 + solver.add_edge(0, 1); + solver.add_edge(0, 5); + solver.add_edge(1, 3); + solver.add_edge(2, 1); + solver.add_edge(2, 3); + solver.add_edge(2, 5); + + EXPECT_FALSE(solver.solve()); + +} diff --git a/lib/cpalgo/graph/bipartite/tests/bipartite_check_testcase1.drawio.svg b/lib/cpalgo/graph/bipartite/tests/bipartite_check_testcase1.drawio.svg new file mode 100644 index 00000000..6f4b1c70 --- /dev/null +++ b/lib/cpalgo/graph/bipartite/tests/bipartite_check_testcase1.drawio.svg @@ -0,0 +1,103 @@ + + + + + + + +
+
+
+ 0 +
+
+
+
+ + 0 + +
+
+ + + + +
+
+
+ 1 +
+
+
+
+ + 1 + +
+
+ + + + +
+
+
+ 3 +
+
+
+
+ + 3 + +
+
+ + + + + +
+
+
+ 5 +
+
+
+
+ + 5 + +
+
+ + + + +
+
+
+ 2 +
+
+
+
+ + 2 + +
+
+ + + + +
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file diff --git a/lib/cpalgo/graph/bipartite/tests/bipartite_check_testcase2.drawio.svg b/lib/cpalgo/graph/bipartite/tests/bipartite_check_testcase2.drawio.svg new file mode 100644 index 00000000..d7d0c398 --- /dev/null +++ b/lib/cpalgo/graph/bipartite/tests/bipartite_check_testcase2.drawio.svg @@ -0,0 +1,104 @@ + + + + + + + +
+
+
+ 0 +
+
+
+
+ + 0 + +
+
+ + + + +
+
+
+ 1 +
+
+
+
+ + 1 + +
+
+ + + + +
+
+
+ 3 +
+
+
+
+ + 3 + +
+
+ + + + + +
+
+
+ 5 +
+
+
+
+ + 5 + +
+
+ + + + +
+
+
+ 2 +
+
+
+
+ + 2 + +
+
+ + + + + +
+ + + + + Viewer does not support full SVG 1.1 + + + +
\ No newline at end of file