79101401

Date: 2024-10-18 09:22:48
Score: 2
Natty:
Report link

If I understand well, you are trying to find all simple cycles of size 4 in your graph.

It is quite straightforward with NetworkX:

for c in nx.simple_cycles(G):
    if len(c)==4: print(c)

You may need to know a bit more about graph theory (and specifically cycles) or check the NetworkX documentation on Cycles.

Cheers!

Reasons:
  • Blacklisted phrase (1): Cheers
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: el_grezeq