Incidence counts for multigraphs #
This file counts actual multigraph edge identities incident to vertices and vertex sets. The two
vertex counts differ only in their treatment of loops: Graph.incidenceCount counts a loop once,
while Graph.nonloopIncidenceCount discards it. Parallel edges are always counted separately.
Both definitions use Set.ncard, so they return zero when the set being counted is infinite.
For finite sets of actual vertices, Graph.neighborsIn G S T is the set of vertices in T
joined by an edge to a vertex in S, ignoring edge multiplicity.
For finite actual edge sets, Graph.internalEdges and Graph.incidentEdges provide the finite
sets of edges internal to, or incident with, a finite set of actual vertices. These are the
counting objects used by degree arguments and by orientation constraints. The comparison with
SimpleGraph.degree shows that the multigraph count specializes to the usual simple-graph degree.
The edge-deletion results record that surviving incident edges together with deleted incident
edges account for the original incidence count.
Neighbours within a set of vertices #
The incidence set of a vertex is finite when the graph has finitely many actual edges.
When the incidence set is finite, the incident edges split into the nonloop incident edges and the loops at the vertex.
On a loopless multigraph, counting all incident edges is the same as counting nonloop incident edges.
Deleting edges removes precisely the deleted members of a vertex's incidence set.
The incidence count after edge deletion counts exactly the surviving incident edges.
When the incidence set is finite, the surviving and deleted incident-edge counts add to the original incidence count.
Deleting edges removes precisely the deleted members of a vertex's nonloop incidence set.
Basic examples #
A graph with no edges has an empty incidence set at every vertex.
A graph with no edges has incidence count zero at every vertex.
Every edge identity of a banana graph is incident to its left endpoint.
Every edge identity of a bouquet is incident to its unique vertex.
Every edge identity of a banana graph is incident to its left endpoint, so the incidence
count there is E.ncard, which is zero when E is infinite.
Every edge identity of a bouquet is a loop at its unique vertex, so its incidence count is
E.ncard, which is zero when E is infinite.
A bouquet has no nonloop incident edges, independently of how many loops it has.
When the endpoints of a banana graph are distinct, every edge is nonloop and the count at the
left endpoint is E.ncard, which is zero when E is infinite.
Every edge internal to S is incident with S.
Enlarging a vertex set enlarges its set of internal edges.
Enlarging a vertex set enlarges its set of incident edges.
An edge has no end in S exactly when both of its ends lie in the complement of S.
Summing over S the values of the edges incident with each vertex counts every actual edge
once for each vertex of S incident with it.
The multigraph associated to a simple graph is loopless.
An edge of Graph.ofSimpleGraph H is incident to a vertex exactly when it is an edge of H
containing that vertex.
The multigraph incidence set of Graph.ofSimpleGraph H is the usual simple-graph incidence
set.
The incidence count on Graph.ofSimpleGraph H is the degree in H.