MyNixOS website logo
Description

R's Shortest Path Problem with Forbidden Subpaths.

An implementation of functionalities to transform directed graphs that are bound to a set of known forbidden paths. There are several transformations, following the rules provided by Villeneuve and Desaulniers (2005) <doi: 10.1016/j.ejor.2004.01.032>, and Hsu et al. (2009) <doi: 10.1007/978-3-642-03095-6_60>. The resulting graph is generated in a data-frame format. See rsppfp website for more information, documentation an examples.

rsppfp

CRAN_Status_Badge CRAN Downloads Travis-CI Build Status Coverage Status License: GPL v3 DOI

The rsppfp package implements different algorithms for transforming graphs in the Shortest Path Problem with Forbidden Paths (SPPFP). This problem is an important concept in the field of graph theories, and it is a variant of the traditional shortest path problem. In here, there is an additional constrait that takes the form of a finite set of forbidden paths (arc sequences of at least three nodes) that cannot be part of any solution path.

This problem is solved by transforming the original graph G and its set of forbidden paths F, generating a new graph G* in which traditional shortest path algorithms can be applied, and obtain solutions that abide to the restrictions. This approach has a number of advantages:

  • It allows solving the original shortest path problem in G* with algorithms that efficiently manage time and processing resources constraints, having been implemented in a plethora of languages.
  • The resulting G* is highly compatible with existing libraries, and can be used as input data for other, more complex problems and researches.
  • In many cases -i.e. logistics- G and F remain unchanged for long periods of time. Thus, the transformation is completed only once, and G* can be stored along with the original graph. A new conversion is required only on the rare cases where the graph, or its forbidden paths, are modified.
  • The input data is provided as common data frames, increasing the versatility of this package.

This solving process is illustrated in Figure 1, using a paper notation to indicate input and output data. Even more, rsppfp scope and key functionalities are also highlighted.

Algorithms

rsppfp implements two different algorithms, each one suited for different situations:

  1. Villeneuve and Desaulniers (2005) proposed the first algorithm. In this case, the set F must be known beforehand. This transformation is slightly fast, but generates bigger graphs G*. Each forbidden path can be of different size, but no sub-path (of at least three nodes long) can be part of another forbidden path.
  2. Hsu et al. 'Backward Construction' (2009) solves the restriction of sub-paths in the forbidden paths, and generates smaller graphs G*, by adding less new nodes and arcs. However, this algorithm is slightly slower.

Both algorithms are analyzed using 27 graphs, randomly generated. The complete benchmark evaluation can be found here.

Installation

As from 2018-11-22 you can install rsppfp directly from CRAN, using:

install.packages("rsppfp")

You can also install the development version of rsppfp from GitHub with:

# install.packages("devtools")
devtools::install_github("melvidoni/rsppfp")

References

Available at References.

Metadata

Version

1.0.4

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows