# Question: Is there any simplified code for classification of Non-isomorphism graphs of order 7 by diameter？

## Question: Is there any simplified code for classification of Non-isomorphism graphs of order 7 by diameter？

Maple

As the title says， I'd like to  divide Non-isomorphism  graphs of order 7   into 6 parts according  diameter of graph.

I write following codes:

restart:
with(GraphTheory):
for i from 1 to 7 do
D||i:=[]:
od:

prc:=NonIsomorphicGraphs(7,output=iterator,outputform=graph,restrictto = connected ):
graphmark := prc():
while graphmark <> FAIL  do
if Diameter(graphmark) = 1 then
D1:=[op(D1),graphmark];
elif Diameter(graphmark) = 2 then
D2:=[op(D2),graphmark];
elif Diameter(graphmark) = 3 then
D3:=[op(D3),graphmark];
elif Diameter(graphmark) = 4 then
D4:=[op(D4),graphmark];
elif Diameter(graphmark) = 5 then
D5:=[op(D5),graphmark];
elif Diameter(graphmark) = 6 then
D6:=[op(D6),graphmark];
fi:
graphmark:=prc():
end do:

But I think  conditional statements  if.. elif are used to many  in  above maple  codes,  it is not concise.

How to write better?

﻿