B2R2


DiGraph<'D, 'E> Type

Directedg graph inehrited from Graph. This type is mostly used by primary graph algorithms, such as the dominator algorithm. We only expose static members here to make code consistent for both persistent and imperative graphs.

Constructors

Constructor Description

DiGraph(arg1)

Full Usage: DiGraph(arg1)

Parameters:
Returns: DiGraph<'D, 'E>
arg0 : GraphCore<'D, 'E, DiGraph<'D, 'E>>
Returns: DiGraph<'D, 'E>

Static members

Static member Description

DiGraph.addDummyEdge arg1 arg2 arg3

Full Usage: DiGraph.addDummyEdge arg1 arg2 arg3

Parameters:
Returns: DiGraph<'D, 'E>

Add an edge to the graph without attaching data to it.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D>
arg2 : Vertex<'D>
Returns: DiGraph<'D, 'E>

DiGraph.addDummyVertex arg1

Full Usage: DiGraph.addDummyVertex arg1

Parameters:
Returns: Vertex<'D> * DiGraph<'D, 'E>

Add a dummy vertex to the graph. Dummy nodes are necessary when we run some graph algorithms, and such nodes should be removed appropriately before we return the final results.

arg0 : DiGraph<'D, 'E>
Returns: Vertex<'D> * DiGraph<'D, 'E>

DiGraph.addEdge arg1 arg2 arg3 arg4

Full Usage: DiGraph.addEdge arg1 arg2 arg3 arg4

Parameters:
Returns: DiGraph<'D, 'E>

Add an edge to the graph.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D>
arg2 : Vertex<'D>
arg3 : 'E
Returns: DiGraph<'D, 'E>

DiGraph.addVertex arg1 arg2

Full Usage: DiGraph.addVertex arg1 arg2

Parameters:
Returns: Vertex<'D> * DiGraph<'D, 'E>

Add a vertex to the graph.

arg0 : DiGraph<'D, 'E>
arg1 : 'D
Returns: Vertex<'D> * DiGraph<'D, 'E>

DiGraph.clone arg1

Full Usage: DiGraph.clone arg1

Parameters:
Returns: DiGraph<'D, 'E>

Clone a graph. For imperative graphs, this function involves deep copying.

arg0 : DiGraph<'D, 'E>
Returns: DiGraph<'D, 'E>

DiGraph.existsVertex arg1 arg2

Full Usage: DiGraph.existsVertex arg1 arg2

Parameters:
Returns: bool

Check if the given vertex exists in the graph.

arg0 : DiGraph<'D, 'E>
arg1 : VertexID
Returns: bool

DiGraph.findEdgeData arg1 arg2 arg3

Full Usage: DiGraph.findEdgeData arg1 arg2 arg3

Parameters:
Returns: 'E

Find an edge and return the data attached to it. This function raises an exception when there is no matching edge.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D>
arg2 : Vertex<'D>
Returns: 'E

DiGraph.findVertexBy arg1 arg2

Full Usage: DiGraph.findVertexBy arg1 arg2

Parameters:
Returns: Vertex<'D>

Find vertex by the given predicate. This function raises an exception when there is no matching vertex.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D> -> bool
Returns: Vertex<'D>

DiGraph.findVertexByData arg1 arg2

Full Usage: DiGraph.findVertexByData arg1 arg2

Parameters:
Returns: Vertex<'D>

Find vertex by given data. This function raises an exception when there is no matching vertex in the graph.

arg0 : DiGraph<'D, 'E>
arg1 : 'D
Returns: Vertex<'D>

DiGraph.findVertexByID arg1 arg2

Full Usage: DiGraph.findVertexByID arg1 arg2

Parameters:
Returns: Vertex<'D>

Find vertex by VertexID. This function raises an exception when the given ID does not exist in the graph.

arg0 : DiGraph<'D, 'E>
arg1 : VertexID
Returns: Vertex<'D>

DiGraph.foldEdge arg1 arg2 arg3

Full Usage: DiGraph.foldEdge arg1 arg2 arg3

Parameters:
Returns: 'a

Fold edges in the graph.

arg0 : DiGraph<'D, 'E>
arg1 : 'a -> Vertex<'D> -> Vertex<'D> -> 'E -> 'a
arg2 : 'a
Returns: 'a

DiGraph.foldVertex arg1 arg2 arg3

Full Usage: DiGraph.foldVertex arg1 arg2 arg3

Parameters:
Returns: 'a

Fold vertices in the graph.

arg0 : DiGraph<'D, 'E>
arg1 : 'a -> Vertex<'D> -> 'a
arg2 : 'a
Returns: 'a

DiGraph.getExits arg1

Full Usage: DiGraph.getExits arg1

Parameters:
Returns: Vertex<'D> list

Get leaf (exit) nodes from the graph.

arg0 : DiGraph<'D, 'E>
Returns: Vertex<'D> list

DiGraph.getPreds arg1 arg2

Full Usage: DiGraph.getPreds arg1 arg2

Parameters:
Returns: Vertex<'D> list

Get the predecessors of the given vertex in the graph.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D>
Returns: Vertex<'D> list

DiGraph.getSize arg1

Full Usage: DiGraph.getSize arg1

Parameters:
Returns: int

Get the number of vertices of the graph.

arg0 : DiGraph<'D, 'E>
Returns: int

DiGraph.getSuccs arg1 arg2

Full Usage: DiGraph.getSuccs arg1 arg2

Parameters:
Returns: Vertex<'D> list

Get the successors of the given vertex in the graph.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D>
Returns: Vertex<'D> list

DiGraph.getUnreachables arg1

Full Usage: DiGraph.getUnreachables arg1

Parameters:
Returns: Vertex<'D> list

Get unreachable nodes from the graph.

arg0 : DiGraph<'D, 'E>
Returns: Vertex<'D> list

DiGraph.getVertices arg1

Full Usage: DiGraph.getVertices arg1

Parameters:
Returns: Set<Vertex<'D>>

Get the whole set of vertices from the graph.

arg0 : DiGraph<'D, 'E>
Returns: Set<Vertex<'D>>

DiGraph.isEmpty arg1

Full Usage: DiGraph.isEmpty arg1

Parameters:
Returns: bool

Check if the graph is empty.

arg0 : DiGraph<'D, 'E>
Returns: bool

DiGraph.iterEdge arg1 arg2

Full Usage: DiGraph.iterEdge arg1 arg2

Parameters:

Iterate edges in the graph.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D> -> Vertex<'D> -> 'E -> unit

DiGraph.iterVertex arg1 arg2

Full Usage: DiGraph.iterVertex arg1 arg2

Parameters:

Iterate vertices in the graph.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D> -> unit

DiGraph.removeEdge arg1 arg2 arg3

Full Usage: DiGraph.removeEdge arg1 arg2 arg3

Parameters:
Returns: DiGraph<'D, 'E>

Remove an edge from the graph.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D>
arg2 : Vertex<'D>
Returns: DiGraph<'D, 'E>

DiGraph.removeVertex arg1 arg2

Full Usage: DiGraph.removeVertex arg1 arg2

Parameters:
Returns: DiGraph<'D, 'E>

Remove a vertex from the graph.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D>
Returns: DiGraph<'D, 'E>

DiGraph.reverse arg1

Full Usage: DiGraph.reverse arg1

Parameters:
Returns: DiGraph<'D, 'E>

Create a reverse graph.

arg0 : DiGraph<'D, 'E>
Returns: DiGraph<'D, 'E>

DiGraph.subGraph arg1 arg2

Full Usage: DiGraph.subGraph arg1 arg2

Parameters:
Returns: DiGraph<'D, 'E>

Return a subgraph of the given vertices.

arg0 : DiGraph<'D, 'E>
arg1 : Set<Vertex<'D>>
Returns: DiGraph<'D, 'E>

DiGraph.toDOTStr arg1 arg2 arg3 arg4

Full Usage: DiGraph.toDOTStr arg1 arg2 arg3 arg4

Parameters:
    arg0 : DiGraph<'D, 'E>
    arg1 : string
    arg2 : Vertex<'D> -> string
    arg3 : Edge<'E> -> string

Returns: string

Return a DOT-formatted string from the graph.

arg0 : DiGraph<'D, 'E>
arg1 : string
arg2 : Vertex<'D> -> string
arg3 : Edge<'E> -> string
Returns: string

DiGraph.tryFindEdgeData arg1 arg2 arg3

Full Usage: DiGraph.tryFindEdgeData arg1 arg2 arg3

Parameters:
Returns: 'E option

Try to find an edge and return the data attached to it.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D>
arg2 : Vertex<'D>
Returns: 'E option

DiGraph.tryFindVertexBy arg1 arg2

Full Usage: DiGraph.tryFindVertexBy arg1 arg2

Parameters:
Returns: Vertex<'D> option

Try to find vertex by given data.

arg0 : DiGraph<'D, 'E>
arg1 : Vertex<'D> -> bool
Returns: Vertex<'D> option

DiGraph.tryFindVertexByData arg1 arg2

Full Usage: DiGraph.tryFindVertexByData arg1 arg2

Parameters:
Returns: Vertex<'D> option

Try to find vertex by given data.

arg0 : DiGraph<'D, 'E>
arg1 : 'D
Returns: Vertex<'D> option

DiGraph.tryFindVertexByID arg1 arg2

Full Usage: DiGraph.tryFindVertexByID arg1 arg2

Parameters:
Returns: Vertex<'D> option

Try to find vertex by VertexID.

arg0 : DiGraph<'D, 'E>
arg1 : VertexID
Returns: Vertex<'D> option