A bipartite graph (aka bigraph) is a graph whose vertices can be divided into two disjoint sets such that vertices from one set only connect to the vertices from the other set and not each other. Applications where they arise include resource planning and coding theory.
Questions tagged [bipartite]
378 questions
-3
votes
1 answer
Maximal matching in a bipartite graph
I am stuck with a maximal matching in a bipartite graph problem. The problem goes something like this:
Given a board with m circular holes and given a set of n circular discs. Holes are numbered as h1, ..., hm, and discs as d1, ..., dn.
We have a…

rits
- 19
- 1
- 6
-3
votes
2 answers
Program works fine only for one test case - Debugging
I want to know whether my graph is bipartite or not, I have several test cases. If I run more than one test case it doesn't work properly, it always shows Bipartite. I am having a hard time figuring it out. For just one case, it works fine for any…

Born2Code
- 99
- 6
-4
votes
0 answers
Check if a graph is bipartite given adjacency matrix of the graph
The code below is returning true for connected bipartite graphs but false for unconnected bipartite graphs. It's failing the test case for graph [[1,3],[0,2],[1,3],[0,2]].
class Solution {
public:
bool isBipartite(vector>& graph) {
…

Asha
- 1
- 3