How to draw fractal graph in networkx library? - python

I need to draw fractal graph or self-similar graph (for example like in picture below)
Does the networkx library have a special function for constructing this graph?

Related

Create a network graph with curved edges using plotly networkx

I m trying to make an interactive graph on plotly, where I first create the network graph using networkx, and then graph it with plotly so that it can be hosted and be interative and shared, very similar to what's described here: https://plotly.com/python/network-graphs/
I would like to make the edges curved -- in networkx I can do this with connectionstyle="arc3,rad=-0.3". How do I do this in Plotly?
My main problem is that edges are overlapping, I want to remove that overlapping if there is any better option please suggest but restricted to plotly only.
I searched in documentations of go.scatter too but didn't found anything relevant to my query.

Drawing a directed graph with NetworkX by overlapping minimum edges

I'm trying to draw a directed graph in python with networkx
It uses Fruchterman-Reingold force-directed algorithm to position nodes. However, I couldn't get a result of graph with minimum overlapping edges. I want something like this in NetworkX or some other python API.
Can Fruchterman-Reingold algorithm produce a graph with minimum overlapping edges? If it can, which parameter should I adjust? If it can not, is there any API or alogrithm to use in python?
My code to visualize
pos = nx.spring_layout(G, k=100, iterations=500, seed=1)
Let me know if you need more info.!
Thanks!

Is there a way to make a network graph in plotly with curved edges?

I'm trying to make an interactive graph on plotly, where I first create the network graph using networkx, and then graph it with plotly so that it can be hosted and be interative and shared, very similar to what's described here: https://plotly.com/python/network-graphs/
I would like to make the edges curved -- in networkx I can do this with connectionstyle="arc3,rad=-0.3". How do I do this in Plotly?

Hexagone lattices

I want to create a hexagonal lattice using the NetworkX python library. But it should be centered basically the whole lattice is a central hexagon and then layers of hexagon around
In python with NetworkX you would want to use the hexagonal_lattice_graph function which is part of it's generators class.
Something like this:
import networkx as nx
G = nx.generators.lattice.hexagonal_lattice_graph(2,2)
nx.draw(G)
Will give a graph which you'd want:
2x2 lattice output

Python networkx Drawing overlay subgroups in a graph

I am wondering if it is possible to create a graph using python and possibly networkx, overlaid subgraphs having different colors? These subgraphs are cluster of nodes. An example of such graph can be found at:
http://www.barabasilab.com/pubs/CCNR-ALB_Publications/200904-10_PLoSCompBio-HumanPhenotypes/200904-10_PLoSCompBio-Fig2sm.png

Categories

Resources