Python Forum
networkx to show traffic help to get started
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
networkx to show traffic help to get started
#1
I am going to be using both networkx and matplotlib to produce a graph.

The graph data input is 'currently' in the format of a dictionary. The dictionary comes in the following format:

Dict = {A > B: 1, A > C: 2, C > D: 3}

The letters respresenting the nodes. So above it means that A connects to B and A also connects to C...

The numbers actually represent a count, so my end goal is to produce thicker lines for a higher count or possibly a different colour based on the final look of the graph.

I'm just looking for a starting point. The dictionary is large and i have only given a very small sample as an example.

My questions:

1. Is there a way to use the dictionary in its present form with network x?

2. Should I look to convert the dictionary keys and split this out into a list format for example: (A, B), (A,C), (C,D). I think I can work out how to create the nodes and edges if it is in this format. However, if I go down this route I am not sure how I will be able to relate each connection as a count to create the thickness of the lines. So say A > B has a count of 1 and A to C has a count of C.

Any help in getting me started would be much appreciated. I'm hoping you understand what I am trying to do :-)
Reply


Messages In This Thread
networkx to show traffic help to get started - by paul41 - Nov-23-2019, 05:19 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Networkx / Data Science IamAlbert 0 1,613 Sep-11-2020, 05:33 PM
Last Post: IamAlbert

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020