Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to represent a graph to be stored in a text file [closed]

Tags:

My problem involves creating a directed graph, checking if it unique by comparing to a text file containing graphs and if it is unique, appending it to the file. What would be the best representation of graph to be used in that case? I'm using Python and I'll be using brute-force to check if graphs are isomorphic, since the graphs are small and have some restrictions.

like image 968
A. Napster Avatar asked Aug 24 '17 13:08

A. Napster


1 Answers

There is a standard text based format called DOT which allows you to work with directed and undirected graphs, and would give you the benefit of using a variety of different libraries to work with your graphs. Notably graphviz which allows you to read and write DOT files, as well as plot them graphically using matplotlib.

like image 97
Duncan WP Avatar answered Oct 11 '22 13:10

Duncan WP