4

I am looking for a graph theoretical software. I can draw a graph delete or add its vertices and edges whatever I want. The software shall give me the Adjacency matrix, degree matrix etc.

Is such a software exists? If available please provide its name and publisher.

Anyhow how can I implement it in C or C++?

I am currently using Matlab, but it is not much helpful.

Thank you for your help.

Supriyo
  • 6,329
  • 7
  • 33
  • 64

3 Answers3

3

You can use sage, http://www.sagemath.org/. Suppose, for example, to find the adjacent matrix of $K_5$, then the following program will find it for you.

sage: g= graphs.CompleteGraph(5)

sage: g.adjacency_matrix()

The manual is here http://www.sagemath.org/doc/reference/graphs/sage/graphs/generic_graph.html

D. N.
  • 2,221
2

I wrote some software in Matlab for this task for my own purposes, and it is available for download from my website: Graph Manager. It was designed to work with Matlab 6.5 (the only version I own which was released over 10 years ago) and you should unzip it and run it with graphm from inside the created directory. It should look like this:

graphm1

You can use the mouse to add/delete vertices and edges and do other things. Since it was for my use there are probably a few things that are unclear, feel free to ask here if there is a problem.

Since it was mainly used to look at graphs on the torus you will need to switch that off if you see the green box; you do that with "Save/Disp" and the "shape" submenu. To get the adjacency matrix you can just go to the main Matlab window and it will be in the global variable A.

jp26
  • 1,484
  • Excuse me, two days I was out of station and could not check this post. I have downloaded it. I shall contact you latter. Thank you. – Supriyo Apr 07 '14 at 06:22
  • The last paragraph is not clear. How to access "Miscellaneous" ? – Supriyo Apr 07 '14 at 09:13
  • Sorry, I just realised that version 1 is the one on the website. It should be simpler for your use. I've adjusted the instructions about how to get the adjacency matrix now. – jp26 Apr 07 '14 at 13:02
  • Dear Sir, Thank you very much for your help. I am very new with MATLAB and the graph theory... – Supriyo Apr 08 '14 at 04:57
  • +1 I've searched too long for something like that. Is there a manual? Oh I just realized that I can't upvote today, since I reached my daily limit... – draks ... Jul 07 '14 at 21:12
  • Sorry, no manual, but if there's something that doesn't do what you think, feel free to ask here. – jp26 Jul 08 '14 at 00:15
  • @jp26 are there any key shortcuts? And does it support an algorithm to color the edge? – draks ... Jul 08 '14 at 07:19
  • There are shortcuts using the underlined letters, so alt V to get to the vertex menu, etc. I've never needed edge colouring, so didn't implement it, sorry. It should be possible to add it with a bit of coding knowledge though. – jp26 Jul 08 '14 at 10:04
1

Current releases of Matlab (from 2016 at least) implement the graphs in the Bioinformatics toolbox, the functions are pretty advanced right now and allow you to draw graphs, extract adjacency matrices etc.

linello
  • 307