networks
graphical
tests whether a list of integers is graphical
Calling Sequence
Parameters
Description
Examples
graphical(intlist)
graphical(intlist, 'MULTI')
intlist
-
list of non-negative integers
'MULTI'
specifies that multigraph is permitted
Important: The networks package has been deprecated. Use the superseding package GraphTheory instead.
This procedure tests whether intlist is the degree sequence of a simple graph (or multigraph with no loops if 'MULTI' is specified).
If intlist is graphical (multigraphical) the procedure call returns a list of edges for one realization of intlist as a graph. Otherwise it returns FAIL.
This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[graphical](...).
with⁡networks:
new⁡G:
addvertex⁡1,2,3,4,5,6,7,G:
graphical⁡6,4,6,4,4,4,6
1,7,1,3,1,5,1,4,1,6,1,2,3,7,6,7,4,7,5,7,2,7,2,3,3,5,3,4,3,6,2,6,4,5
addedge⁡,G:
degreeseq⁡G
4,4,4,4,6,6,6
new⁡H:
addvertex⁡1,2,3,4,5,6,7,H:
graphical⁡3,3,6,6,6,3,3,MULTI
3,4,3,5,3,4,3,5,3,4,3,5,4,5,4,7,4,6,1,2,2,5,1,2,6,7,1,7,5,6
addedge⁡,H:
vdegree⁡3,H
6
graphical⁡5,4,3,2,1,1
FAIL
See Also
GraphTheory
networks(deprecated)[degreeseq]
networks(deprecated)[maxdegree]
networks(deprecated)[mindegree]
Download Help Document