# Cmat2ArcList: Builds the list of arcs of a graph from its cost matrix In optrees: Optimal Trees in Weighted Graphs

### Description

The Cmat2ArcList function builds the list of arcs of a graph from a cost matrix that contains the weights of all the arcs.

### Usage

 1 Cmat2ArcList(nodes, Cmat, directed = TRUE) 

### Arguments

 nodes vector containing the nodes of the graph, identified by a number that goes from 1 to the order of the graph. Cmat n\times n matrix that contains the weights or costs of the arcs. Row i and column j represents the endpoints of an arc, and the value of the index ij is its weight or cost. If this value is NA or Inf means that there is no arc ij. directed logical value indicating whether the graph is directed (TRUE) or not (FALSE).

### Value

Cmat2ArcList returns a 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.

optrees documentation built on May 19, 2017, 8:30 p.m.

Search within the optrees package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.