Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 text in the nodes. Nodes being same width and height would be ideal.

A WPF control would be perfect, as it exists for graph#. Perhaps even a XAML definition exists? As an alternativ: a report window can also be very good.

Probably someone with more experience in Graph# can provide hints on how to do this utilizing Graph#.

Tried around a bit with NodeXL but that seems not to be the perfect solution, as the nodes seems not be that much modifiable. Perhaps someone can provide a better solution. Have played with the NetworkView provided by Soroush. At the moment this comes closest to what I want.

-update- Tried out NetworkView shared by Soroush Falahati. This seems to be a good base, but is not yet that flexible as I need it. I have problems to believe that there is no library out there that can do those things out of the box. (NetworkView has the excellent feature to set connections / edges in the control which gives it an extra boost over the NodeXL). Perhaps Graph# can do even more, but at the moment I just have tried those two.

like image 399
Mare Infinitus Avatar asked Jan 30 '13 13:01

Mare Infinitus


People also ask

How do you represent a bipartite graph?

The complete bipartite graph on m and n vertices, denoted by Kn,m is the bipartite graph. , where U and V are disjoint sets of size m and n, respectively, and E connects every vertex in U with all vertices in V. It follows that Km,n has mn edges.

What does it mean if a graph is bipartite?

A bipartite graph, also called a bigraph, is a set of graph vertices decomposed into two disjoint sets such that no two graph vertices within the same set are adjacent.


2 Answers

You can approximate your bipartite graph visualization in NodeXL, and even improve on it by removing edge crossings. I took your sample bipartite graph, and in the image below I colored the nodes by their side (u or v). They are laid out using the Sugiyama algorithm that minimizes edge crossings. I did this in the interactive NodeXL template for Excel 2007--2013, but all these features should be available as the standalone NodeXL C# and WPF class libraries. The current libraries as of this post are available to download here.

Bipartite graph in NodeXL Sugiyama layout

I also tried NodeXL's group-in-a-box layout to separate the groups and display them each individually in a grid, with marginal results.

NodeXL bipartite graph

Disclaimer: I'm an advisor for the NodeXL project.

like image 156
edallme Avatar answered Sep 23 '22 15:09

edallme


Actually if you could use client side jquery .. iwoul strongly recommend jqPlumbs.. http://www.jsplumb.org/jquery/demo.html

like image 37
Mortalus Avatar answered Sep 24 '22 15:09

Mortalus