 LineGraph - Maple Help

GraphTheory

 LineGraph
 construct line graph of graph Calling Sequence LineGraph(G) Parameters

 G - graph Description

 • The LineGraph command creates the line graph $L\left(G\right)$ of a given graph G.
 • If G is undirected, the vertices of $L\left(G\right)$ are the edges of G, and two vertices are connected by an edge if the corresponding edges in G share a vertex.
 • If G is directed, the vertices of $L\left(G\right)$ are the edges of G, and there is a directed edge from u to v if the target of the edge in G corresponding to u is equal to the source of the edge in G corresponding to v. Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{K4}≔\mathrm{CompleteGraph}\left(4\right)$
 ${\mathrm{K4}}{≔}{\mathrm{Graph 1: an undirected graph with 4 vertices and 6 edge\left(s\right)}}$ (1)
 > $\mathrm{DrawGraph}\left(\mathrm{K4}\right)$ > $L≔\mathrm{LineGraph}\left(\mathrm{K4}\right)$
 ${L}{≔}{\mathrm{Graph 2: an undirected graph with 6 vertices and 12 edge\left(s\right)}}$ (2)
 > $\mathrm{DrawGraph}\left(L\right)$ > $\mathrm{Vertices}\left(L\right)$
 $\left[{"1-2"}{,}{"1-3"}{,}{"1-4"}{,}{"2-3"}{,}{"2-4"}{,}{"3-4"}\right]$ (3)
 > $\mathrm{Edges}\left(\mathrm{GraphComplement}\left(L\right)\right)$
 $\left\{\left\{{"1-2"}{,}{"3-4"}\right\}{,}\left\{{"1-3"}{,}{"2-4"}\right\}{,}\left\{{"1-4"}{,}{"2-3"}\right\}\right\}$ (4) Compatibility

 • The GraphTheory[LineGraph] command was updated in Maple 2023.