Class RandomGraph

java.lang.Object
edu.cmu.tetrad.graph.RandomGraph

public class RandomGraph extends Object

RandomGraph class.

Version:
$Id: $Id
Author:
josephramsey
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Generates random DAGs uniformly with certain classes of DAGs using variants of Markov chain algorithm by Malancon, Dutour, and Philippe.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    addTwoCycles(Graph graph, int numTwoCycles)
    addTwoCycles.
    static void
    fixLatents1(int numLatentConfounders, Graph graph)
    fixLatents1.
    static void
    fixLatents4(int numLatentConfounders, Graph graph)
    fixLatents4.
    static Graph
    randomCyclicGraph2(int numNodes, int numEdges, int maxDegree)
    Makes a cyclic graph by repeatedly adding cycles of length of 3, 4, or 5 to the graph, then finally adding two cycles.
    static Graph
    randomCyclicGraph3(int numNodes, int numEdges, int maxDegree, double probCycle, double probTwoCycle)
    Makes a cyclic graph by repeatedly adding cycles of length of 3, 4, or 5 to the graph, then finally adding two cycles.
    static Graph
    randomDag(int numNodes, int numLatentConfounders, int maxNumEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)
    randomDag.
    static Dag
    randomDag(List<Node> nodes, int numLatentConfounders, int maxNumEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)
    randomDag.
    static Graph
    randomGraph(int numNodes, int numLatentConfounders, int numEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)
    randomGraph.
    static Graph
    randomGraph(List<Node> nodes, int numLatentConfounders, int maxNumEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)
    Defaults to random forward graphs.
    static Graph
    randomGraphRandomForwardEdges(int numNodes, int numLatentConfounders, int numEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)
    randomGraphRandomForwardEdges.
    static Graph
    randomGraphRandomForwardEdges(List<Node> nodes, int numLatentConfounders, int numEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)
    randomGraphRandomForwardEdges.
    static Graph
    randomGraphRandomForwardEdges(List<Node> nodes, int numLatentConfounders, int numEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected, boolean layoutAsCircle)
    randomGraphRandomForwardEdges.
    static Graph
    randomGraphUniform(List<Node> nodes, int numLatentConfounders, int maxNumEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected, int numIterations)
    randomGraphUniform.
    static Graph
    randomScaleFreeGraph(int numNodes, int numLatentConfounders, double alpha, double beta, double delta_in, double delta_out)
    randomScaleFreeGraph.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • RandomGraph

      public RandomGraph()
  • Method Details

    • randomDag

      public static Graph randomDag(int numNodes, int numLatentConfounders, int maxNumEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)

      randomDag.

      Parameters:
      numNodes - a int
      numLatentConfounders - a int
      maxNumEdges - a int
      maxDegree - a int
      maxIndegree - a int
      maxOutdegree - a int
      connected - a boolean
      Returns:
      a Graph object
    • randomDag

      public static Dag randomDag(List<Node> nodes, int numLatentConfounders, int maxNumEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)

      randomDag.

      Parameters:
      nodes - a List object
      numLatentConfounders - a int
      maxNumEdges - a int
      maxDegree - a int
      maxIndegree - a int
      maxOutdegree - a int
      connected - a boolean
      Returns:
      a Dag object
    • randomGraph

      public static Graph randomGraph(int numNodes, int numLatentConfounders, int numEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)

      randomGraph.

      Parameters:
      numNodes - a int
      numLatentConfounders - a int
      numEdges - a int
      maxDegree - a int
      maxIndegree - a int
      maxOutdegree - a int
      connected - a boolean
      Returns:
      a Graph object
    • randomGraph

      public static Graph randomGraph(List<Node> nodes, int numLatentConfounders, int maxNumEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)
      Defaults to random forward graphs.
      Parameters:
      nodes - a List object
      numLatentConfounders - a int
      maxNumEdges - a int
      maxDegree - a int
      maxIndegree - a int
      maxOutdegree - a int
      connected - a boolean
      Returns:
      a Graph object
    • randomGraphUniform

      public static Graph randomGraphUniform(List<Node> nodes, int numLatentConfounders, int maxNumEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected, int numIterations)

      randomGraphUniform.

      Parameters:
      nodes - a List object
      numLatentConfounders - a int
      maxNumEdges - a int
      maxDegree - a int
      maxIndegree - a int
      maxOutdegree - a int
      connected - a boolean
      numIterations - a int
      Returns:
      a Graph object
    • randomGraphRandomForwardEdges

      public static Graph randomGraphRandomForwardEdges(int numNodes, int numLatentConfounders, int numEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)

      randomGraphRandomForwardEdges.

      Parameters:
      numNodes - a int
      numLatentConfounders - a int
      numEdges - a int
      maxDegree - a int
      maxIndegree - a int
      maxOutdegree - a int
      connected - a boolean
      Returns:
      a Graph object
    • randomGraphRandomForwardEdges

      public static Graph randomGraphRandomForwardEdges(List<Node> nodes, int numLatentConfounders, int numEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected)

      randomGraphRandomForwardEdges.

      Parameters:
      nodes - a List object
      numLatentConfounders - a int
      numEdges - a int
      maxDegree - a int
      maxIndegree - a int
      maxOutdegree - a int
      connected - a boolean
      Returns:
      a Graph object
    • randomGraphRandomForwardEdges

      public static Graph randomGraphRandomForwardEdges(List<Node> nodes, int numLatentConfounders, int numEdges, int maxDegree, int maxIndegree, int maxOutdegree, boolean connected, boolean layoutAsCircle)

      randomGraphRandomForwardEdges.

      Parameters:
      nodes - a List object
      numLatentConfounders - a int
      numEdges - a int
      maxDegree - a int
      maxIndegree - a int
      maxOutdegree - a int
      connected - a boolean
      layoutAsCircle - a boolean
      Returns:
      a Graph object
    • randomScaleFreeGraph

      public static Graph randomScaleFreeGraph(int numNodes, int numLatentConfounders, double alpha, double beta, double delta_in, double delta_out)

      randomScaleFreeGraph.

      Parameters:
      numNodes - a int
      numLatentConfounders - a int
      alpha - a double
      beta - a double
      delta_in - a double
      delta_out - a double
      Returns:
      a Graph object
    • fixLatents1

      public static void fixLatents1(int numLatentConfounders, Graph graph)

      fixLatents1.

      Parameters:
      numLatentConfounders - a int
      graph - a Graph object
    • fixLatents4

      public static void fixLatents4(int numLatentConfounders, Graph graph)

      fixLatents4.

      Parameters:
      numLatentConfounders - a int
      graph - a Graph object
    • randomCyclicGraph2

      public static Graph randomCyclicGraph2(int numNodes, int numEdges, int maxDegree)
      Makes a cyclic graph by repeatedly adding cycles of length of 3, 4, or 5 to the graph, then finally adding two cycles.
      Parameters:
      numNodes - a int
      numEdges - a int
      maxDegree - a int
      Returns:
      a Graph object
    • randomCyclicGraph3

      public static Graph randomCyclicGraph3(int numNodes, int numEdges, int maxDegree, double probCycle, double probTwoCycle)
      Makes a cyclic graph by repeatedly adding cycles of length of 3, 4, or 5 to the graph, then finally adding two cycles.
      Parameters:
      numNodes - a int
      numEdges - a int
      maxDegree - a int
      probCycle - a double
      probTwoCycle - a double
      Returns:
      a Graph object
    • addTwoCycles

      public static void addTwoCycles(Graph graph, int numTwoCycles)

      addTwoCycles.

      Parameters:
      graph - a Graph object
      numTwoCycles - a int