Learn R Programming

gor (version 2.0)

Algorithms for the Subject Graphs and Network Optimization

Description

Informal implementation of some algorithms from Graph Theory and Combinatorial Optimization which arise in the subject "Graphs and Network Optimization" from first course of the EUPLA degree of Data Engineering in Industrial Processes.

Copy Link

Version

Install

install.packages('gor')

Monthly Downloads

171

Version

2.0

License

GPL-3

Maintainer

Cesar Asensio

Last Published

September 1st, 2025

Functions in gor (2.0)

compute_lower_bound_HK

Held-Karp lower bound estimate
compute_lower_bound_1tree

Computing the 1-tree lower bound for a TSP instance
compute_gain_transp

Distance gain when transposing two cities in a tour
build_tour_nn_best

Build a tour for a TSP using the best nearest neighbor heuristic
compute_cut_weight

Compute cut weight and size
compute_distance_matrix

\(p\)-distance matrix computation
compute_path_distance

Compute the distance of a TSP path
color_graph_greedy

Greedy coloring of a graph
compute_tour_distance

Compute the distance of a TSP tour
compute_p_distance

Distance-p between two-dimensional points
crossover_sequences

Crossover of sequences
find_euler

Constructing an Eulerian Cycle
gor

Graphs and Network Optimization algorithms
crossover_tours

Crossover operation used by the TSP genetic algorithm
gauge_tour

Gauging a tour
dijk

Dijkstra' algorithm for shortest paths
find_cover_BB

Branch-and-Bound algorithm for the Vertex-Cover problem
dfs_tree

Depth-first search tree
generate_fundamental_cycles

Generate fundamental cycles in a connected graph
find_tour_BB

Branch-and-Bound algorithm for the TSP
make_cube

Multidimensional cube graph
krus

Minimum spanning tree (Boruvka-Kruskal algorithm)
mutate_binary_sequence

Binary sequence mutation
improve_tour_LinKer

Tour improving for a TSP using a poor version of the Lin-Kernighan heuristic
improve_cover_flip

Improving a cover with local search
improve_tour_2opt

Tour improving for a TSP using the 2-opt heuristic
is_cover

Check vertex cover
improve_cut_flip

Improving a cut with local search
improve_tour_3opt

Tour improving for a TSP using the 3-opt heuristic
neigh_index

Previous, current, and next positions of a given index in a cycle.
plot_cover

Vertex cover plotting
next_index

Next position to i in a cycle
plot_tour

TSP tour simple plotting
search_cut_genetic

Genetic Algorithm for Max-Cut
search_cover_ants

Ant colony optimization algorithm for Vertex-Cover
prim

Minimum spanning tree (Jarnik-Prim algorithm)
search_cover_random

Random vertex covers
perturb_tour_4exc

Random 4-exchange transformation
search_tour_ants

Ant colony optimization algorithm for the TSP
plot_cut

Cut plotting
search_tour_genetic

Genetic Algorithm for the TSP
shave_cycle

Shaving a hairy cycle
sum_g

Sum of the higher terms of a list
search_tour_chain2opt

Chained 2-opt search with multiple, random starting tours
build_tour_2tree

Double-tree heuristic for TSP
bfs_tree

Breadth-first search tree
build_cut_greedy

Greedy algorithm aimed to build a large weight cut in a graph
build_cover_approx

2-approximation algorithm for vertex cover
build_cover_random

Random vertex covers
build_tour_greedy

Building a tour for a TSP using the greedy heuristic
build_tour_nn

Building a tour for a TSP using the nearest neighbor heuristic
build_cut_random

Random cut generation on a graph
apply_incidence_map

Apply incidence map of a graph to an edge vector
build_cover_greedy

Greedy algorithm for vertex cover in a graph