FRODO Version 2.19.1
An open-source framework for Distributed Constraint Optimization (DCOP)
Loading...
Searching...
No Matches
frodo2.algorithms.RandGraphFactory Class Reference

Generator of random graphs. More...

Classes

class  Graph
 A graph. More...
class  Edge
 An edge. More...

Static Public Member Functions

static Graph getSizedRandGraph (int nbrNodes, int nbrEdges, int nbrClusters)
 Creates a random graph with the desired size.
static Graph getRandGraph (int maxNbrNodes, int maxNbrEdges, int maxNbrClusters)
 Generates a random undirected graph.
static Graph getNiceRandGraph (int maxNbrNodes, int maxNbrEdges, int maxNbrClusters)
 Generates a random graph in which, for each cluster, all variables in that cluster belong to the same graph component.
static Graph getRandGraph (int maxNbrNodes, int maxNbrEdges)
 Generates a random undirected graph.
static Graph getRingGraph (int nbrNodes)
 Generates a ring of the input size, without specified clusters.
static Graph getSquareGrid (int side)
 Generates a square grid of the desired size.
static Graph getAcyclicGraph (int nbrNodes, int branchingFactor)
 Generates a single-component, acyclic graph of the desired size, with the desired branching factor.
static Graph getChordalGraph (int nbrNodes, double rateOfChords)
 Generates a chordal graph.

Detailed Description

Generator of random graphs.

Author
Thomas Leaute

Member Function Documentation

◆ getAcyclicGraph()

Graph frodo2.algorithms.RandGraphFactory.getAcyclicGraph ( int nbrNodes,
int branchingFactor )
static

Generates a single-component, acyclic graph of the desired size, with the desired branching factor.

Parameters
nbrNodesthe number of nodes
branchingFactoreach node has at most (branchingFactor + 1) neighbors
Returns
the graph

Referenced by frodo2.benchmarks.party.PartyGame.generateAcyclicProblem(), frodo2.benchmarks.party.PartyGame.main(), and frodo2.algorithms.maxsum.tests.MaxSumTests< V extends Addable< V >, U extends Addable< U > >.test().

◆ getChordalGraph()

Graph frodo2.algorithms.RandGraphFactory.getChordalGraph ( int nbrNodes,
double rateOfChords )
static

Generates a chordal graph.

Parameters
nbrNodesthe number of nodes
rateOfChordsrateOfChords % of the edges are chords
Returns
the graph

References frodo2.algorithms.RandGraphFactory.Graph.components, frodo2.algorithms.RandGraphFactory.Graph.edges, getRingGraph(), frodo2.algorithms.RandGraphFactory.Graph.neighborhoods, and frodo2.algorithms.RandGraphFactory.Graph.nodes.

Referenced by frodo2.benchmarks.party.PartyGame.generateChordalProblem(), and frodo2.benchmarks.party.PartyGame.main().

Here is the call graph for this function:

◆ getNiceRandGraph()

Graph frodo2.algorithms.RandGraphFactory.getNiceRandGraph ( int maxNbrNodes,
int maxNbrEdges,
int maxNbrClusters )
static

Generates a random graph in which, for each cluster, all variables in that cluster belong to the same graph component.

Parameters
maxNbrNodesmax number of nodes
maxNbrEdgesmax number of edges
maxNbrClustersmax number of clusters; if 0, no clusters are created
Returns
a random graph in which, for each cluster, all variables in that cluster belong to the same graph component

References frodo2.algorithms.RandGraphFactory.Graph.clusters, frodo2.algorithms.RandGraphFactory.Graph.componentOf, and getRandGraph().

Referenced by frodo2.algorithms.dpop.stochastic.robust.test.Robust_E_DPOPagentTest< V extends Addable< V > >.setUp(), frodo2.algorithms.dpop.stochastic.test.E_DPOPagentTest< V extends Addable< V > >.setUp(), and frodo2.algorithms.dpop.stochastic.test.ExpectedUTILtest.setUp().

Here is the call graph for this function:

◆ getRandGraph() [1/2]

Graph frodo2.algorithms.RandGraphFactory.getRandGraph ( int maxNbrNodes,
int maxNbrEdges )
static

Generates a random undirected graph.

The graph contains at least 2 nodes. There can be only at most 1 edge between any two given nodes.

Parameters
maxNbrNodesmaximum number of nodes. Must be at least 2.
maxNbrEdgesmaximum number of edges
Returns
a random graph

References getRandGraph().

Here is the call graph for this function:

◆ getRandGraph() [2/2]

Graph frodo2.algorithms.RandGraphFactory.getRandGraph ( int maxNbrNodes,
int maxNbrEdges,
int maxNbrClusters )
static

Generates a random undirected graph.

The graph contains at least 2 nodes. There can be only at most 1 edge between any two given nodes.

Parameters
maxNbrNodesmaximum number of nodes. Must be at least 2.
maxNbrEdgesmaximum number of edges
maxNbrClustersmaximum number of clusters; if 0, no clusters are created
Returns
a random graph

References getSizedRandGraph().

Referenced by frodo2.algorithms.test.AllTests.createRandProblem(), frodo2.algorithms.test.AllTests.createRandProblem(), frodo2.algorithms.test.AllTests.createRandProblem(), frodo2.algorithms.test.AllTests.createRandProblem(), getNiceRandGraph(), getRandGraph(), frodo2.algorithms.dpop.privacy.test.SecureRerootingTest.randomTest(), frodo2.algorithms.adopt.test.testADOPT.setUp(), frodo2.algorithms.adopt.test.testPreprocessing.setUp(), frodo2.algorithms.asodpop.tests.ASODPOPBinaryTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.asodpop.tests.ASODPOPTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.count.test.TestCountSolutions.setUp(), frodo2.algorithms.dpop.param.test.ParamDPOPtest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.param.test.ParamUTILtest< U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.param.test.ParamVALUEtest< U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.privacy.test.SecureCircularRoutingTest.setUp(), frodo2.algorithms.dpop.privacy.test.VariableObfuscationTest< V extends Addable< V > >.setUp(), frodo2.algorithms.dpop.stochastic.test.E_DPOPagentTest< V extends Addable< V > >.setUp(), frodo2.algorithms.dpop.stochastic.test.LowestCommonAncestorsTest.setUp(), frodo2.algorithms.dpop.test.DPOPagentTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.test.UTILpropagationTest< U extends Addable< U > >.setUp(), frodo2.algorithms.dpop.test.VALUEpropagationTest< U extends Addable< U > >.setUp(), frodo2.algorithms.duct.tests.DUCTagentChildSearchTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentChildTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentPruningSearchTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentPruningTest.setUp(), frodo2.algorithms.duct.tests.DUCTagentTest.setUp(), frodo2.algorithms.duct.tests.NormalizeInfTest.setUp(), frodo2.algorithms.duct.tests.NormalizeTest.setUp(), frodo2.algorithms.localSearch.dsa.tests.TestDSA< U extends Addable< U > >.setUp(), frodo2.algorithms.odpop.tests.UTILpropagationTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.odpop.tests.VALUEpropagationTest< V extends Addable< V >, U extends Addable< U > >.setUp(), frodo2.algorithms.test.ProblemTest.setUp(), frodo2.algorithms.test.XCSPparserTest.setUp(), frodo2.algorithms.varOrdering.dfs.tests.DFSgenerationTest.setUp(), frodo2.algorithms.varOrdering.election.tests.LeaderElectionMaxIDTest< S extends Comparable< S > >.setUp(), frodo2.algorithms.varOrdering.election.tests.VariableElectionTest< S extends Comparable< S > &Serializable >.setUp(), frodo2.algorithms.varOrdering.linear.tests.CentralLinearOrderingTest.setUp(), and frodo2.controller.TestController.setUp().

Here is the call graph for this function:

◆ getRingGraph()

Graph frodo2.algorithms.RandGraphFactory.getRingGraph ( int nbrNodes)
static

Generates a ring of the input size, without specified clusters.

Parameters
nbrNodesthe desired number of nodes
Returns
the graph

Referenced by frodo2.benchmarks.party.PartyGame.generateRingProblem(), getChordalGraph(), and frodo2.benchmarks.party.PartyGame.main().

◆ getSizedRandGraph()

Graph frodo2.algorithms.RandGraphFactory.getSizedRandGraph ( int nbrNodes,
int nbrEdges,
int nbrClusters )
static

Creates a random graph with the desired size.

There can be only at most 1 edge between any two given nodes.

Parameters
nbrNodesnumber of nodes
nbrEdgesnumber of edges
nbrClustersnumber of clusters; if 0, no clusters are created
Returns
a random graph

References frodo2.algorithms.RandGraphFactory.Edge.dest.

Referenced by frodo2.algorithms.test.AllTests.createSizedRandProblem(), frodo2.benchmarks.maxdiscsp.MaxDisCSPProblemGenerator.createSizedRandProblem(), getRandGraph(), and frodo2.benchmarks.graphcoloring.GraphColoring.GraphColoring().

◆ getSquareGrid()

Graph frodo2.algorithms.RandGraphFactory.getSquareGrid ( int side)
static

Generates a square grid of the desired size.

Parameters
sidethe graph contains side*side nodes
Returns
the graph

Referenced by frodo2.benchmarks.party.PartyGame.generateGridProblem(), and frodo2.benchmarks.party.PartyGame.main().


The documentation for this class was generated from the following file: