Questions tagged [bipartite]

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.

378 questions
7
votes
6 answers

Visualize bipartite graph

Can someone recommend a library or code to visualize bipartite graphs in C#? Graph# seems not to support this kind of graph directly (but has some support to disentangle vertices). I want to create some graphic like this bipartite graph with some…
Mare Infinitus
  • 8,024
  • 8
  • 64
  • 113
6
votes
3 answers

networkx maximal_matching() does not return maximum matching

I'm learning to use the networkx python module to do some matchings of a bipartite graph. There are two functions in the module that give the maximum cardinality matching of a graph: nx.maximal_matching() nx.bipartite.maxmum_matching() Note that…
Jason
  • 2,950
  • 2
  • 30
  • 50
6
votes
2 answers

Combinatorics in Python

I have a sort of a one level tree structure as: Where p are parent nodes, c are child nodes and b are hypothetical branches. I want to find all combinations of branches under the constraint that only one parent can branch to only one child node,…
Theodor
  • 5,536
  • 15
  • 41
  • 55
6
votes
3 answers

How do display bipartite graphs with python networkX package?

How does one display a bipartite graph in the python networkX package, with the nodes from one class in a column on the left and those from the other class on the right? I can create a graph and display it like this B =…
James A. Foster
  • 141
  • 1
  • 1
  • 6
6
votes
3 answers

Writing a program to check if a graph is bipartite

I need to write a program that check if a graph is bipartite. I have read through wikipedia articles about graph coloring and bipartite graph. These two article suggest methods to test bipartiteness like BFS search, but I cannot write a program…
John Graveston
  • 111
  • 1
  • 1
  • 5
6
votes
1 answer

Weighted bipartite matching

I'm aware of there's a lot of similar topics. But most of them left me some doubts in my case. What I want to do is find perfect matching (or as close to perfect as possible in case there's no perfect matching of course) and then from all of those…
abc
  • 2,371
  • 3
  • 25
  • 36
6
votes
1 answer

Find all maximal complete bipartite subgraph from given bipartite graph

Given is a bipartite graph, and we want to list all maximal complete bipartite sub-graph. For instance, vertex set L = {A, B, C, D} vertex set R = {a, b, c, d, e} edges: A-a, A-b, B-a, B-b, C-c, C-d, D-c, D-d, D-e The maximal complete bipartite…
ColinBinWang
  • 485
  • 6
  • 8
5
votes
2 answers

NetworkX - generating a random connected bipartite graph

I'm using NetworkX to generate a bipartite graph using either nx.bipartite.random_graph or nx.bipartite.gnmk_random_graph, as follows: B = bipartite.gnmk_random_graph(5,6,10) bottom_nodes, top_nodes = bipartite.sets(B) However, I get an…
monadoboi
  • 1,651
  • 3
  • 16
  • 26
5
votes
2 answers

How can I get optimal matching between K groups?

I have K sets of data points, I would like to make groups of size K which minimize the total sum of intra group distances. I'm familiar with matching algorithms with bipartite graphs, but I would like this for more than two sets. Any ideas? Edit :…
user3091275
  • 1,013
  • 2
  • 11
  • 27
5
votes
1 answer

Algorithm for minimum vertex cover in Bipartite graph

I am trying to figure out an algorithm for finding minimum vertex cover of a bipartite graph. I was thinking about a solution, that reduces the problem to maximum matching in bipartite graph. It's known that it can be found using max flow in networ…
yrak
  • 61
  • 1
  • 3
5
votes
0 answers

Matching students to courses with course limit (Hungarian, Max Flow, Min-Cost-Flow, ...)

I am currently writing a program which maps students to courses. Currently, I am using a SAT-Solver, but I am trying to implement a polynomial time / non greedy algorithm which solves the following sub-problem: There are students (50-150) There are…
5
votes
1 answer

Bipartite matching in Python

Does anybody know any module in Python that computes the best bipartite matching? I have tried the following two: munkres hungarian However, in my case, I have to deal with non-complete graph (i.e., there might not be an edge between two nodes),…
vailen
  • 187
  • 1
  • 3
  • 7
5
votes
2 answers

The Integrality theorem in maximum flow

The integraloty theorem tells us that if all capacities in a flow network are integers, then there is a maximum flow where every value is an integer But the most remarkable part is the existence, not every maximum flow! Which means this statement…
Romantic Amaj
  • 113
  • 1
  • 7
5
votes
6 answers

How do I partition a bipartite graph by color?

For instance, suppose I have a graph G = (V, E) where V = {A, B, C, D} E = {(A, B), (A,D), (C, D)} This graph is bipartite, and thus can be split into two disjoint sets {A, C} and {B, D}. My first guess is that I can simply walk the graph and…
Jason Baker
  • 192,085
  • 135
  • 376
  • 510
4
votes
1 answer

how to convert Bipartite Matching to Independent Set

I read the book Algorithm Design, chapter 1, it gave a very short description of how to convert Bipartite Matching to Independent Set Problem and I don't get it. Do anybody know that any detailed matriel to describe this process? Thanks!
Sili
  • 927
  • 1
  • 12
  • 17
1
2
3
25 26