Visualising directed hyperedges in network graph Python - python

I'm trying to visualise a multi-edge directed graph, with hyper-edges. I've looked into python NetworkX, I'm starting with the directed graph, which can basically give me this:
But I would like to visualise my edges combined (since they are a kind of "bundle", with multiple source vertices, and one destination vertex).
Like this:
Any help would be appreciated.

Related

How to find communities using graph tool "minimize_blockmodel_d"?

I would like to use graph tool subpackage : minimize_blockmodel_dl
https://graph-tool.skewed.de/static/doc/inference.html#graph_tool.inference.minimize_blockmodel_dl to find communities in a network.
I write code like this:
state = gt.minimize_blockmodel_dl(G). G is the graph containing nodes and edges. I wonder how can I do next to get the specific communities?

networkX.draw() not producing edges

I'm not sure why my network graph doesn't include edges.
I'm creating a network from a pandas dataframe that looks like the following:
I created the network as follows:
G = nx.from_pandas_edgelist(network_df,
edge_attr='weight',
source='Source',
target='Target',
create_using=nx.Graph())
but nx.draw(G) produces a graph without edges.
I tried using nx.DigGraph() but the result is the same.
Any help is greatly appreciated.
That central "blob" in your plot is a lot of nodes connected together which probably do have edges, but they are obscured by the dense mass of nodes. On the periphery there are a few nodes joined together by edges, but due to the plotting algorithm they pairs (or somewhat larger cluster) are again so close together that the nodes are obscured. The isolated nodes are isolated.
It's probably best to try another layout. The default is spring_layout. Here's another that will probably show it better:
pos = nx.circular_layout(G)
nx.draw(G, pos)
As a general rule, networkx was not designed for the purpose of graph visualization. So you may need to look at other tools like graphviz.

Networkx: How to visually group a set of nodes

I would like to visually group a set of nodes in networkx. Of course one could do so by changing node color, size etc. My preferred solution however should look something like the plot created with igraph below. Is this possible in networkx?

Networkx graph with fixed assortativity

Could anyone help me with generating graphs of predetermined assortativity using networkx? I want to show as an example that two networks with the same density and average centrality can have very different assortativities. Is there any way of generating these graphs using networkx? Thanks, Rajat.

How to arrange nodes of graph with top N (eg. top 5) major component above and small component below in a figure?

I am using networkx to visualize a graph, I want to draw something like the attached figure. All the small connected components are align below the major components, anyone know how to do it with networkx or other python package? Thanks a lot

Categories

Resources