"Pseudograph" redirects here; not to be confused withPseudepigraph.
A multigraph with multiple edges (red) and several loops (blue). Not all authors allow multigraphs to have loops.
Inmathematics, and more specifically ingraph theory, amultigraph is agraph which is permitted to havemultiple edges (also calledparallel edges[1]), that is,edges that have the sameend nodes. Thus two vertices may be connected by more than one edge.
There are 2 distinct notions of multiple edges:
Edges without own identity: The identity of an edge is defined solely by the two nodes it connects. In this case, the term "multiple edges" means that the same edge can occur several times between these two nodes.
Edges with own identity: Edges are primitive entities just like nodes. When multiple edges connect two nodes, these are different edges.
A multigraph is different from ahypergraph, which is a graph in which an edge can connect any number of nodes, not just two.
For some authors, the termspseudograph andmultigraph are synonymous. For others, apseudograph is a multigraph that is permitted to haveloops.
Undirected multigraph (edges without own identity)
r :E → {{x,y} :x,y ∈V}, assigning to each edge an unordered pair of endpoint nodes.
Some authors allow multigraphs to haveloops, that is, an edge that connects a vertex to itself,[2] while others call thesepseudographs, reserving the term multigraph for the case with no loops.[3]
Amultidigraph is adirected graph which is permitted to havemultiple arcs, i.e., arcs with the same source and target nodes. A multidigraphG is an ordered pairG := (V,A) with
V a set ofvertices ornodes,
A a multiset of ordered pairs of vertices calleddirected edges,arcs orarrows.
Amixed multigraphG := (V,E,A) may be defined in the same way as amixed graph.
This notion might be used to model the possible flight connections offered by an airline. In this case the multigraph would be adirected graph with pairs of directed parallel edges connecting cities to show that it is possible to fly bothto andfrom these locations.
Incategory theory a smallcategory can be defined as a multidigraph (with edges having their own identity) equipped with an associative composition law and a distinguished self-loop at each vertex serving as the left and right identity for composition. For this reason, in category theory the termgraph is standardly taken to mean "multidigraph", and the underlying multidigraph of a category is called itsunderlying digraph.
Multigraphs and multidigraphs also support the notion ofgraph labeling, in a similar way. However there is no unity in terminology in this case.
The definitions oflabeled multigraphs andlabeled multidigraphs are similar, and we define only the latter ones here.
Definition 1: A labeled multidigraph is alabeled graph withlabeled arcs.
Formally: A labeled multidigraph G is a multigraph withlabeled vertices and arcs. Formally it is an 8-tuple where
is a set of vertices and is a set of arcs.
and are finite alphabets of the available vertex and arc labels,
and are two maps indicating thesource andtarget vertex of an arc,
and are two maps describing the labeling of the vertices and arcs.
Definition 2: A labeled multidigraph is alabeled graph with multiplelabeled arcs, i.e. arcs with the same end vertices and the same arc label (note that this notion of a labeled graph is different from the notion given by the articlegraph labeling).