Description Usage Arguments Examples
This object represents a graph and has class methods for easy manipulation.
The graph class has the following class methods:
getAdjMatrix() - Returns the adjacency matrix supplied to the algorithm.
getSize() - Returns the size of the graph
setSize(n) - Sets the size of the graph and enters interactive matrix creation.
getNodeNames() - Returns the saved node names for the graph.
setNodeNames(names) - Sets the node names for the graph, where names is a vector.
isDirected() - Returns TRUE if the graph is directed.
setIsDirected(Boolean) - Set if the graph is directed or not, input is either TRUE or FALSE.
setAdjMatrix(matrix,directed=FALSE) - Replace the graph by providing an adjacency matrix.
constFill(const) - Assign a constant as the cost of every arc in the graph.
randFill(min=0,max=100) - Assign random costs to every arc in the graph.
1 | graph(n)
|
amountOfNodes |
The Number of nodes to make a graph with. |
isGraphDirected |
Create directed graph? Default is TRUE. |
1 2 3 4 | ## Not run:
A <- graph(6)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.