PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, June 27, 2022

[FIXED] How to connect all components of a DiGraph in NetworkX

 June 27, 2022     graph, graph-theory, networkx     No comments   

Issue

I have a directed graph (G), which is made of 65 strongly connected components and 8 weakly connected components. I am aware I can add non-existent edges to connect the entire graph using k-edge-augmentation, but this is only possible with an undirected graph.

Is there any way, within NetworkX, or otherwise to connect the DiGraph to produce one strongly connected component?


Solution

For anyone else coming here in future, one idea I had which I'm probably going to go with is to create both a directed and undirected graph from your data, perform k-edge-augmentation on the undirected graph, and using the edges this returns, add a biconnected component between them in the directed graph.



Answered By - Luca Passariello
Answer Checked By - Clifford M. (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing