LineGraph - Maple Help

GraphTheory

 LineGraph
 construct line graph of graph

 Calling Sequence LineGraph(G)

Parameters

 G - undirected graph

Description

 • The LineGraph command creates the line graph $L\left(G\right)$ of a given graph G. 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 are adjacent.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{K4}≔\mathrm{CompleteGraph}\left(4\right)$
 ${\mathrm{K4}}{≔}{\mathrm{Graph 1: an undirected unweighted 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 unweighted 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)