addEdge.adjListGraph: A Graph Function

Description Usage Arguments Value

Description

This function allows you to add a new edge to an existing graph. If weighted graph, will override previous edge.

Usage

1
2
## S3 method for class 'adjListGraph'
addEdge(graph, node1, node2, weight = 1)

Arguments

node1

The first node

node2

The second node

weight

Defaults to 1 (used for non-weighted graph)

Value

the new graph with the added edge and whether the operation was successful


TheBell/Graph documentation built on May 5, 2019, 4:48 p.m.