I have a list with 7 elements:
elements = ['A','B','C','D','E','F','G']
and I want to make a network starting from A in the center, and going down all the possible paths to each other element, so it would look something like this:
## A->[B1,C1,D1,E1,F1,G1]
## B1 -> [C2,D2,E2,F2,G2] for each of [B1,C1,...,G1]
## C2 -> [D3,E3,F3,G3] for each of the above, etc.
I'm currently trying with the networkx package, the end goal would then be to make it a circular tree graph, maybe color the nodes by the letter or assign some weights etc.
For now though I'm kinda stuck on the aforementioned problem, I've tried many things and it feels like it shouldn't be too tough but I'm not too experienced in these algorithm problems. It looks like it should be some kind of recursion problem. Here's one of the things I've tried if it helps:
def add_edges(network, edge_list,i,previous_ele):
edge_list1 = edge_list.copy()
for ele in edge_list:
network.add_edge(previous_ele+str(i),ele+str(i+1))
edge_list1.remove(ele)
add_edges(network, edge_list1, i+1, ele)
N = nx.DiGraph()
elements = ['A','B','C','D','E','F','G']
elements.remove('A')
for ele in elements:
N.add_edge('A',ele+'1')
for i in range(len(elements)):
add_edges(N, elements, 1, elements[i])
Thanks in advance for any tips!


## B1 -> [C2,D2,E2,F2,G2] for each of [B1,C1,...,G1]