optrees (version 1.0)

searchFlowPath: Find a maximum flow path

Description

searchFlowPath go through a given graph and obtains a maximum flow path between source and sink nodes. The function uses a deep-first search estrategy.

Usage

searchFlowPath(nodes, arcs, source.node = 1, sink.node = nodes[length(nodes)])

Arguments

nodes
vector containing the nodes of the graph, identified by a number that goes from $1$ to the order of the graph.
arcs
matrix with the list of arcs of the graph. Each row represents one arc. The first two columns contain the two endpoints of each arc and the third column contains their weights.
source.node
number pointing to the source node of the graph. It's node $1$ by default.
sink.node
number pointing to the sink node of the graph. It's the last node by default.

Value

searchFlowPath returns a list with two elements:
path.nodes
vector with nodes of the path.
path.arcs
matrix with the list of arcs that form the maximum flow path.

See Also

This function is an auxiliar function used in ghTreeGusfield and getMinimumCutTree.