Ask Your Question
0

How to put the drawing of graphs in a matrix or list

asked 2020-11-25 03:27:09 -0600

anonymous user

Anonymous

updated 2020-11-25 03:44:52 -0600

I have got some graphs on 5 vertices.

count = 0
for g in graphs.nauty_geng("5 1:5"):
    count = count+1
print(count)

we got 19 graphs. I want to show them but get long output using following codes, and it is very bad for viewing.

   for g in graphs.nauty_geng("5 1:5"):
       g.show()

I thought of using matrix or list storage these drawings of graph , but it failed.

glist= [g for g in graphs.nauty_geng("5 1:5")]
map(show,glist)

we got noting from outputs:

<map object at 0x6fdf37c3cf8>

This is what Maple did well.

with(GraphTheory):
graphsof5c := [NonIsomorphicGraphs(5, 1..5,output = graphs, outputform = graph)]:
DrawGraph~(graphsof5c,size=[300,300],stylesheet=[vertexborder=false,vertexpadding=20,edgecolor = "Blue",
               vertexcolor="Gold"])

My points are less than 60 points, I can’t upload corresponding pictures, sorry.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2020-11-25 06:19:11 -0600

fidbc gravatar image

updated 2020-11-25 06:26:34 -0600

I think that the graphs_list.show_graphs is the function you are looking for. Using the notation from above you can execute

sage: graphs_list.show_graphs(glist)

This will display the graphs in glist in blocks of at most 20 graphs. Further details at the user manual.

EDIT: Updated link formatting, link not rendering correctly.

edit flag offensive delete link more

Comments

thanks for your help! it looks good!

licheng gravatar imagelicheng ( 2020-11-27 07:42:12 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2020-11-25 03:27:09 -0600

Seen: 68 times

Last updated: Nov 25 '20