>
|
with(Hypergraphs): with(GraphTheory): with(ExampleHypergraphs):
|
Create a hypergraph from its vertices and edges.
>
|
H := Hypergraph([1,2,3,4,5,6,7], [{1,2,3}, {2,3}, {4}, {3,5,6}]);
|
| (1) |
Print its vertices and edges.
>
|
Hypergraphs:-Vertices(H); Hyperedges(H);
|
| |
| (2) |
Draw a graphical representation of this hypergraph.
Check whether H is connected.
>
|
Hypergraphs:-IsConnected(H);
|
Check whether H is linear.
Construct the line graph L of H.
>
|
L := Hypergraphs:-LineGraph(H);
|
| (5) |
Draw a graphical representation of L.
Construct the vertex-edge-incidence graph M of H.
>
|
M := VertexEdgeIncidenceGraph(H);
|
| (6) |
Draw a graphical representation of L.
Create another hypergraph.
| (7) |
Print its vertices and edges.
>
|
Hypergraphs:-Vertices(H); Hyperedges(H);
|
| |
| (8) |
Draw a graphical representation of this hypergraph.
Check whether H is connected.
>
|
Hypergraphs:-IsConnected(H);
|
Check whether H is linear.
Construct the line graph L of H.
>
|
L := Hypergraphs:-LineGraph(H);
|
| (11) |
Draw a graphical representation of L.
Construct the vertex-edge-incidence graph M of H.
>
|
M := VertexEdgeIncidenceGraph(H);
|
| (12) |
Draw a graphical representation of L.