Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

make_line_graph

Line graph of a graph


Description

This function calculates the line graph of another graph.

Usage

make_line_graph(graph)

line_graph(...)

Arguments

graph

The input graph, it can be directed or undirected.

...

Passed to make_line_graph.

Details

The line graph L(G) of a G undirected graph is defined as follows. L(G) has one vertex for each edge in G and two vertices in L(G) are connected by an edge if their corresponding edges share an end point.

The line graph L(G) of a G directed graph is slightly different, L(G) has one vertex for each edge in G and two vertices in L(G) are connected by a directed edge if the target of the first vertex's corresponding edge is the same as the source of the second vertex's corresponding edge.

Value

A new graph object.

Author(s)

Gabor Csardi csardi.gabor@gmail.com, the first version of the C code was written by Vincent Matossian.

Examples

# generate the first De-Bruijn graphs
g <- make_full_graph(2, directed=TRUE, loops=TRUE)
make_line_graph(g)
make_line_graph(make_line_graph(g))
make_line_graph(make_line_graph(make_line_graph(g)))

igraph

Network Analysis and Visualization

v1.2.10
GPL (>= 2)
Authors
See AUTHORS file.
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.