The complete graph K5 on 5 vertices may be constructed by the statement
> K5 := CompleteGraph( 5 );We construct the Petersen graph first by listing the edges:
> P := Graph< 10 | { 1, 2 }, { 1, 5 }, { 1, 6 }, { 2, 3 }, { 2, 7 },
> { 3, 4 }, { 3, 8 }, { 4, 5 }, { 4, 9 }, { 5, 10 },
> { 6, 8 }, { 6, 9 }, { 7, 9 }, { 7, 10 }, { 8, 10 } >;
We now construct the same graph by listing the neighbours of each vertex:
> P := Graph< 10 | [ { 2, 5, 6 }, { 1, 3, 7 }, { 2, 4, 8 }, { 3, 5, 9 },
> { 1, 4, 10 }, { 1, 8, 9 }, { 2, 9, 10 }, { 3, 6, 10 },
> { 4, 6, 7 }, { 5, 7, 8 } ] >;
We finally construct the same graph in terms of an adjacency matrix:
> M := MatrixRing( IntegerRing(), 10 ); > P := Graph< 10 | M![ 0,1,0,0,1,1,0,0,0,0, > 1,0,1,0,0,0,1,0,0,0, > 0,1,0,1,0,0,0,1,0,0, > 0,0,1,0,1,0,0,0,1,0, > 1,0,0,1,0,0,0,0,0,1, > 1,0,0,0,0,0,0,1,1,0, > 0,1,0,0,0,0,0,0,1,1, > 0,0,1,0,0,1,0,0,0,1, > 0,0,0,1,0,1,1,0,0,0, > 0,0,0,0,1,0,1,1,0,0] >; > P; Graph Vertex Neighbours 1 2 5 6 ; 2 1 3 7 ; 3 2 4 8 ; 4 3 5 9 ; 5 1 4 10 ; 6 1 8 9 ; 7 2 9 10 ; 8 3 6 10 ; 9 4 6 7 ; 10 5 7 8 ;
Next Group: Construction of Tutte's 8-cage Previous Group: Graphs
Up: Graphs