View source: R/1-grafos-basic.R
find_euler | R Documentation |
It finds an Eulerian cycle using a
O(q)
algorithm where q
is the number of edges of
the graph.
find_euler(G, v)
G |
Eulerian and connected graph |
v |
Any vertex as starting point of the cycle |
Recursive algorithm for undirected graphs. The input graph should be Eulerian and connected.
A two-element list: the $walk component is a
q\times2
matrix edgelist, and the $graph component is
the input graph with no edges; it is used in intermediate
steps, when the function calls itself.
This function is part of the subject "Graphs and Network Optimization". It is designed for teaching purposes only, and not for production.
It is introduced in the "Connectivity" section.
It is used as a subroutine in the "TSP" section.
Cesar Asensio (2021)
Korte, Vygen: Combinatorial Optimization (Springer) sec 2.4.
build_tour_2tree double-tree algorithm.
library(igraph)
find_euler(make_full_graph(5), 1)$walk # Walk of length 10
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.