Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
graph_exhaustive_paths_test.cc File Reference

Shortest paths, with weights that admit no negative cycle, on every small multigraph, against the oracles. More...

#include <algorithm>
#include <functional>
#include <limits>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stdexcept>
#include <string>
#include <tuple>
#include <type_traits>
#include <utility>
#include <vector>
#include <gtest/gtest.h>
#include <tpl_graph.H>
#include <Dijkstra.H>
#include <AStar.H>
#include <Zero_One_BFS.H>
#include <Dial.H>
#include <Floyd_Warshall.H>
#include <Johnson.H>
#include <K_Shortest_Paths.H>
#include "graph_filter_catalog.H"
#include "graph_harness.H"
#include "graph_oracles.H"
Include dependency graph for graph_exhaustive_paths_test.cc:

Go to the source code of this file.

Classes

class  ExhaustivePaths< GT >
 
class  ExhaustiveJohnson< GT >
 

Functions

 TYPED_TEST_SUITE (ExhaustivePaths, All_Kinds)
 
 TYPED_TEST (ExhaustivePaths, DijkstraPaintingsMatchTheOracle)
 
 TYPED_TEST (ExhaustivePaths, AStarPaintingsMatchTheOracle)
 
 TYPED_TEST (ExhaustivePaths, PaintedTreesAreCopied)
 
 TYPED_TEST (ExhaustivePaths, DijkstraFindsTheShortestPaths)
 
 TYPED_TEST (ExhaustivePaths, AStarFindsTheShortestPaths)
 
 TYPED_TEST (ExhaustivePaths, AStarWithoutAHeuristicFindsTheShortestPaths)
 
 TYPED_TEST (ExhaustivePaths, DijkstraTreesMatchTheOracle)
 
 TYPED_TEST (ExhaustivePaths, AStarTreesMatchTheOracle)
 
 TYPED_TEST (ExhaustivePaths, DijkstraPaintsWithEveryWeighting)
 
 TYPED_TEST (ExhaustivePaths, DijkstraFindsWithEveryWeighting)
 
 TYPED_TEST (ExhaustivePaths, AStarFindsWithEveryWeighting)
 
 TYPED_TEST (ExhaustivePaths, DijkstraAndAStarOnRandomGraphs)
 
 TYPED_TEST (ExhaustivePaths, DijkstraRespectsTheFilter)
 
 TYPED_TEST (ExhaustivePaths, AStarRespectsTheFilter)
 
 TYPED_TEST (ExhaustivePaths, DijkstraAndAStarAfterAnotherPainting)
 
 TYPED_TEST (ExhaustivePaths, DijkstraAndAStarTakeIntAndDouble)
 
 TYPED_TEST (ExhaustivePaths, KShortestPathsNearTheLimitsOfInt)
 
 TYPED_TEST (ExhaustivePaths, DijkstraNearTheLimitsOfInt)
 
 TYPED_TEST (ExhaustivePaths, AStarNearTheLimitsOfInt)
 
 TYPED_TEST (ExhaustivePaths, DijkstraAndAStarWithAFibonacciHeap)
 
 TYPED_TEST (ExhaustivePaths, ZeroOneBFSMatchesTheOracle)
 
 TYPED_TEST (ExhaustivePaths, ZeroOneBFSTakesEveryWeighting)
 
 TYPED_TEST (ExhaustivePaths, ZeroOneBFSRejectsOtherWeights)
 
 TYPED_TEST (ExhaustivePaths, ZeroOneBFSRespectsTheFilter)
 
 TYPED_TEST (ExhaustivePaths, ZeroOneBFSLeavesOtherPaintingsAlone)
 
 TYPED_TEST (ExhaustivePaths, ZeroOneBFSAndDialOnRandomGraphs)
 
 TYPED_TEST (ExhaustivePaths, DialMatchesTheOracle)
 
 TYPED_TEST (ExhaustivePaths, DialPaintsWithEveryWeighting)
 
 TYPED_TEST (ExhaustivePaths, DialFindsWithEveryWeighting)
 
 TYPED_TEST (ExhaustivePaths, DialRespectsTheFilter)
 
 TYPED_TEST (ExhaustivePaths, FloydMatchesTheOracle)
 
 TYPED_TEST (ExhaustivePaths, FloydTakesEveryWeighting)
 
 TYPED_TEST (ExhaustivePaths, FloydTakesNegativeWeights)
 
 TYPED_TEST (ExhaustivePaths, FloydOnRandomGraphs)
 
 TYPED_TEST (ExhaustivePaths, FloydRespectsTheFilter)
 
 TYPED_TEST (ExhaustivePaths, FloydNearTheLimitsOfInt)
 
 TYPED_TEST (ExhaustivePaths, FloydTakesIntAndDouble)
 
 TYPED_TEST_SUITE (ExhaustiveJohnson, Directed_Kinds)
 
 TYPED_TEST (ExhaustiveJohnson, JohnsonMatchesTheOracle)
 
 TYPED_TEST (ExhaustiveJohnson, JohnsonTakesEveryWeighting)
 
 TYPED_TEST (ExhaustiveJohnson, JohnsonOnRandomGraphs)
 
 TYPED_TEST (ExhaustiveJohnson, JohnsonRespectsTheFilter)
 
 TYPED_TEST (ExhaustiveJohnson, JohnsonNearTheLimitsOfInt)
 
 TYPED_TEST (ExhaustiveJohnson, JohnsonNearTheLowestOfInt)
 
 TYPED_TEST (ExhaustiveJohnson, JohnsonTakesIntAndDouble)
 
 TYPED_TEST (ExhaustivePaths, YenGivesTheSimplePathsInCostOrder)
 
 TYPED_TEST (ExhaustivePaths, EppsteinGivesTheWalksInCostOrder)
 
 TYPED_TEST (ExhaustivePaths, KShortestPathsTakeEveryWeighting)
 
 TYPED_TEST (ExhaustivePaths, YenRespectsTheFilter)
 
 TYPED_TEST (ExhaustivePaths, EppsteinRespectsTheFilter)
 
 TYPED_TEST (ExhaustivePaths, KShortestPathsOnRandomGraphs)
 
 TYPED_TEST (ExhaustivePaths, KShortestPathsTakeIntAndDouble)
 

Detailed Description

Shortest paths, with weights that admit no negative cycle, on every small multigraph, against the oracles.

Each test runs one family of algorithms over every multigraph of a domain of graph_harness.H, with loops, parallel and antiparallel arcs and the arcs in two orders, on every kind of graph that the family takes, and compares each answer with an oracle that does not use Aleph: Floyd on long long for the distances, and the enumeration of the paths, or of the walks, in cost order for the k shortest paths. Every path that an algorithm gives is walked: it must go from its start to its end along arcs of the graph, in their direction in a digraph, that the filter shows, and cost both the distance that came with it and the least one.

The larger domains (up to 4 nodes and 3 arcs; one more of each with ALEPH_GRAPH_HARNESS=heavy) take a few fixed weightings; the smaller ones every weighting from a few values; and random graphs of 6 to 8 nodes come from the seed of graph_harness.H. Other suites hide every set of arcs, run after another algorithm painted the graph, take distances of type int and double (the halves of the weights, so that a distance kept in an integer loses its fraction) and weights near the limits of int.

Definition in file graph_exhaustive_paths_test.cc.

Function Documentation

◆ TYPED_TEST() [1/51]

◆ TYPED_TEST() [2/51]

◆ TYPED_TEST() [3/51]

◆ TYPED_TEST() [4/51]

TYPED_TEST ( ExhaustiveJohnson  ,
JohnsonOnRandomGraphs   
)

Definition at line 3310 of file graph_exhaustive_paths_test.cc.

References w.

◆ TYPED_TEST() [5/51]

TYPED_TEST ( ExhaustiveJohnson  ,
JohnsonRespectsTheFilter   
)

◆ TYPED_TEST() [6/51]

TYPED_TEST ( ExhaustiveJohnson  ,
JohnsonTakesEveryWeighting   
)

◆ TYPED_TEST() [7/51]

TYPED_TEST ( ExhaustiveJohnson  ,
JohnsonTakesIntAndDouble   
)

Definition at line 3563 of file graph_exhaustive_paths_test.cc.

◆ TYPED_TEST() [8/51]

◆ TYPED_TEST() [9/51]

◆ TYPED_TEST() [10/51]

TYPED_TEST ( ExhaustivePaths  ,
AStarNearTheLimitsOfInt   
)

Definition at line 2473 of file graph_exhaustive_paths_test.cc.

◆ TYPED_TEST() [11/51]

◆ TYPED_TEST() [12/51]

◆ TYPED_TEST() [13/51]

◆ TYPED_TEST() [14/51]

TYPED_TEST ( ExhaustivePaths  ,
AStarWithoutAHeuristicFindsTheShortestPaths   
)

◆ TYPED_TEST() [15/51]

TYPED_TEST ( ExhaustivePaths  ,
DialFindsWithEveryWeighting   
)

Definition at line 2867 of file graph_exhaustive_paths_test.cc.

◆ TYPED_TEST() [16/51]

◆ TYPED_TEST() [17/51]

TYPED_TEST ( ExhaustivePaths  ,
DialPaintsWithEveryWeighting   
)

Definition at line 2862 of file graph_exhaustive_paths_test.cc.

◆ TYPED_TEST() [18/51]

◆ TYPED_TEST() [19/51]

◆ TYPED_TEST() [20/51]

◆ TYPED_TEST() [21/51]

TYPED_TEST ( ExhaustivePaths  ,
DijkstraAndAStarTakeIntAndDouble   
)

Definition at line 2177 of file graph_exhaustive_paths_test.cc.

◆ TYPED_TEST() [22/51]

◆ TYPED_TEST() [23/51]

◆ TYPED_TEST() [24/51]

◆ TYPED_TEST() [25/51]

TYPED_TEST ( ExhaustivePaths  ,
DijkstraNearTheLimitsOfInt   
)

Definition at line 2468 of file graph_exhaustive_paths_test.cc.

◆ TYPED_TEST() [26/51]

◆ TYPED_TEST() [27/51]

◆ TYPED_TEST() [28/51]

◆ TYPED_TEST() [29/51]

◆ TYPED_TEST() [30/51]

TYPED_TEST ( ExhaustivePaths  ,
EppsteinGivesTheWalksInCostOrder   
)

◆ TYPED_TEST() [31/51]

TYPED_TEST ( ExhaustivePaths  ,
EppsteinRespectsTheFilter   
)

Definition at line 3672 of file graph_exhaustive_paths_test.cc.

◆ TYPED_TEST() [32/51]

◆ TYPED_TEST() [33/51]

◆ TYPED_TEST() [34/51]

TYPED_TEST ( ExhaustivePaths  ,
FloydOnRandomGraphs   
)

◆ TYPED_TEST() [35/51]

◆ TYPED_TEST() [36/51]

◆ TYPED_TEST() [37/51]

TYPED_TEST ( ExhaustivePaths  ,
FloydTakesIntAndDouble   
)

Definition at line 3164 of file graph_exhaustive_paths_test.cc.

◆ TYPED_TEST() [38/51]

◆ TYPED_TEST() [39/51]

TYPED_TEST ( ExhaustivePaths  ,
KShortestPathsNearTheLimitsOfInt   
)

Definition at line 2463 of file graph_exhaustive_paths_test.cc.

◆ TYPED_TEST() [40/51]

TYPED_TEST ( ExhaustivePaths  ,
KShortestPathsOnRandomGraphs   
)

Definition at line 3677 of file graph_exhaustive_paths_test.cc.

References w.

◆ TYPED_TEST() [41/51]

TYPED_TEST ( ExhaustivePaths  ,
KShortestPathsTakeEveryWeighting   
)

◆ TYPED_TEST() [42/51]

TYPED_TEST ( ExhaustivePaths  ,
KShortestPathsTakeIntAndDouble   
)

◆ TYPED_TEST() [43/51]

◆ TYPED_TEST() [44/51]

TYPED_TEST ( ExhaustivePaths  ,
YenGivesTheSimplePathsInCostOrder   
)

◆ TYPED_TEST() [45/51]

TYPED_TEST ( ExhaustivePaths  ,
YenRespectsTheFilter   
)

Definition at line 3667 of file graph_exhaustive_paths_test.cc.

◆ TYPED_TEST() [46/51]

TYPED_TEST ( ExhaustivePaths  ,
ZeroOneBFSAndDialOnRandomGraphs   
)

◆ TYPED_TEST() [47/51]

◆ TYPED_TEST() [48/51]

◆ TYPED_TEST() [49/51]

◆ TYPED_TEST() [50/51]

◆ TYPED_TEST() [51/51]

TYPED_TEST ( ExhaustivePaths  ,
ZeroOneBFSTakesEveryWeighting   
)

Definition at line 2588 of file graph_exhaustive_paths_test.cc.

◆ TYPED_TEST_SUITE() [1/2]

TYPED_TEST_SUITE ( ExhaustiveJohnson  ,
Directed_Kinds   
)

◆ TYPED_TEST_SUITE() [2/2]

TYPED_TEST_SUITE ( ExhaustivePaths  ,
All_Kinds   
)