Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have vertex.txt and triangle.txt, how to create a networkx graph? #624

Open
tanjia123456 opened this issue Sep 10, 2020 · 2 comments
Open

Comments

@tanjia123456
Copy link

hello, I have vertex.txt and triangle.txt, how to create a networkx graph? my source file hasn't edge information
I have used matplotlib to create a graph, but I can't use nx.adjacency_matrix(G) function to get adj_matrix. My ultimate goal is to generate adjacency matrix

@tanjia123456
Copy link
Author

I have used matplotlib to build a graph, but there is no function to directly find the adjacency matrix
(1) According to vertex and triangle, use networkx to generate graph, and then use nx.adjacency_matrix function to generate adjacency matrix
(2) Extract edge information from triangle.txt, and then use networkx to generate graphs based on edge and vertex
(3) Convert the graph generated by matplotlib directly into the graph of networkx, and then use nx.adjacency_matrix to generate the adjacency matrix

Don't know which method is feasible

@ericmjl
Copy link
Owner

ericmjl commented Sep 13, 2020

@tanjia123456 I think this is a question to be brought to the NetworkX issue tracker, as I am seeing some conceptual misunderstandings that might be difficult to resolve here. For example, NetworkX provides the graph object, while matplotlib merely renders the graph to screen. They are not equivalent. I'd recommend looking through the Network Analysis Made Simple tutorial to learn how to use the NetworkX API first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants