gonum: gonum.org/v1/gonum/graph/simple Index | Files

package simple

import "gonum.org/v1/gonum/graph/simple"

Package simple provides a suite of simple graph implementations satisfying the gonum/graph interfaces.

Index

Package Files

dense_directed_matrix.go dense_undirected_matrix.go directed.go doc.go simple.go undirected.go weighted_directed.go weighted_undirected.go

type DirectedGraph Uses

type DirectedGraph struct {
    // contains filtered or unexported fields
}

DirectedGraph implements a generalized directed graph.

func NewDirectedGraph Uses

func NewDirectedGraph() *DirectedGraph

NewDirectedGraph returns a DirectedGraph.

func (*DirectedGraph) AddNode Uses

func (g *DirectedGraph) AddNode(n graph.Node)

AddNode adds n to the graph. It panics if the added node ID matches an existing node ID.

func (*DirectedGraph) Edge Uses

func (g *DirectedGraph) Edge(uid, vid int64) graph.Edge

Edge returns the edge from u to v if such an edge exists and nil otherwise. The node v must be directly reachable from u as defined by the From method.

func (*DirectedGraph) Edges Uses

func (g *DirectedGraph) Edges() graph.Edges

Edges returns all the edges in the graph.

func (*DirectedGraph) From Uses

func (g *DirectedGraph) From(id int64) graph.Nodes

From returns all nodes in g that can be reached directly from n.

func (*DirectedGraph) HasEdgeBetween Uses

func (g *DirectedGraph) HasEdgeBetween(xid, yid int64) bool

HasEdgeBetween returns whether an edge exists between nodes x and y without considering direction.

func (*DirectedGraph) HasEdgeFromTo Uses

func (g *DirectedGraph) HasEdgeFromTo(uid, vid int64) bool

HasEdgeFromTo returns whether an edge exists in the graph from u to v.

func (*DirectedGraph) NewEdge Uses

func (g *DirectedGraph) NewEdge(from, to graph.Node) graph.Edge

NewEdge returns a new Edge from the source to the destination node.

func (*DirectedGraph) NewNode Uses

func (g *DirectedGraph) NewNode() graph.Node

NewNode returns a new unique Node to be added to g. The Node's ID does not become valid in g until the Node is added to g.

func (*DirectedGraph) Node Uses

func (g *DirectedGraph) Node(id int64) graph.Node

Node returns the node with the given ID if it exists in the graph, and nil otherwise.

func (*DirectedGraph) Nodes Uses

func (g *DirectedGraph) Nodes() graph.Nodes

Nodes returns all the nodes in the graph.

func (*DirectedGraph) RemoveEdge Uses

func (g *DirectedGraph) RemoveEdge(fid, tid int64)

RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal nodes. If the edge does not exist it is a no-op.

func (*DirectedGraph) RemoveNode Uses

func (g *DirectedGraph) RemoveNode(id int64)

RemoveNode removes the node with the given ID from the graph, as well as any edges attached to it. If the node is not in the graph it is a no-op.

func (*DirectedGraph) SetEdge Uses

func (g *DirectedGraph) SetEdge(e graph.Edge)

SetEdge adds e, an edge from one node to another. If the nodes do not exist, they are added and are set to the nodes of the edge otherwise. It will panic if the IDs of the e.From and e.To are equal.

func (*DirectedGraph) To Uses

func (g *DirectedGraph) To(id int64) graph.Nodes

To returns all nodes in g that can reach directly to n.

type DirectedMatrix Uses

type DirectedMatrix struct {
    // contains filtered or unexported fields
}

DirectedMatrix represents a directed graph using an adjacency matrix such that all IDs are in a contiguous block from 0 to n-1. Edges are stored implicitly as an edge weight, so edges stored in the graph are not recoverable.

func NewDirectedMatrix Uses

func NewDirectedMatrix(n int, init, self, absent float64) *DirectedMatrix

NewDirectedMatrix creates a directed dense graph with n nodes. All edges are initialized with the weight given by init. The self parameter specifies the cost of self connection, and absent specifies the weight returned for absent edges.

func NewDirectedMatrixFrom Uses

func NewDirectedMatrixFrom(nodes []graph.Node, init, self, absent float64) *DirectedMatrix

NewDirectedMatrixFrom creates a directed dense graph with the given nodes. The IDs of the nodes must be contiguous from 0 to len(nodes)-1, but may be in any order. If IDs are not contiguous NewDirectedMatrixFrom will panic. All edges are initialized with the weight given by init. The self parameter specifies the cost of self connection, and absent specifies the weight returned for absent edges.

func (*DirectedMatrix) Edge Uses

func (g *DirectedMatrix) Edge(uid, vid int64) graph.Edge

Edge returns the edge from u to v if such an edge exists and nil otherwise. The node v must be directly reachable from u as defined by the From method.

func (*DirectedMatrix) Edges Uses

func (g *DirectedMatrix) Edges() graph.Edges

Edges returns all the edges in the graph.

func (*DirectedMatrix) From Uses

func (g *DirectedMatrix) From(id int64) graph.Nodes

From returns all nodes in g that can be reached directly from n.

func (*DirectedMatrix) HasEdgeBetween Uses

func (g *DirectedMatrix) HasEdgeBetween(xid, yid int64) bool

HasEdgeBetween returns whether an edge exists between nodes x and y without considering direction.

func (*DirectedMatrix) HasEdgeFromTo Uses

func (g *DirectedMatrix) HasEdgeFromTo(uid, vid int64) bool

HasEdgeFromTo returns whether an edge exists in the graph from u to v.

func (*DirectedMatrix) Matrix Uses

func (g *DirectedMatrix) Matrix() mat.Matrix

Matrix returns the mat.Matrix representation of the graph. The orientation of the matrix is such that the matrix entry at G_{ij} is the weight of the edge from node i to node j.

func (*DirectedMatrix) Node Uses

func (g *DirectedMatrix) Node(id int64) graph.Node

Node returns the node with the given ID if it exists in the graph, and nil otherwise.

func (*DirectedMatrix) Nodes Uses

func (g *DirectedMatrix) Nodes() graph.Nodes

Nodes returns all the nodes in the graph.

func (*DirectedMatrix) RemoveEdge Uses

func (g *DirectedMatrix) RemoveEdge(fid, tid int64)

RemoveEdge removes the edge with the given end point nodes from the graph, leaving the terminal nodes. If the edge does not exist it is a no-op.

func (*DirectedMatrix) SetEdge Uses

func (g *DirectedMatrix) SetEdge(e graph.Edge)

SetEdge sets e, an edge from one node to another with unit weight. If the ends of the edge are not in g or the edge is a self loop, SetEdge panics. SetEdge will store the nodes of e in the graph if it was initialized with NewDirectedMatrixFrom.

func (*DirectedMatrix) SetWeightedEdge Uses

func (g *DirectedMatrix) SetWeightedEdge(e graph.WeightedEdge)

SetWeightedEdge sets e, an edge from one node to another. If the ends of the edge are not in g or the edge is a self loop, SetWeightedEdge panics. SetWeightedEdge will store the nodes of e in the graph if it was initialized with NewDirectedMatrixFrom.

func (*DirectedMatrix) To Uses

func (g *DirectedMatrix) To(id int64) graph.Nodes

To returns all nodes in g that can reach directly to n.

func (*DirectedMatrix) Weight Uses

func (g *DirectedMatrix) Weight(xid, yid int64) (w float64, ok bool)

Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. If x and y are the same node or there is no joining edge between the two nodes the weight value returned is either the graph's absent or self value. Weight returns true if an edge exists between x and y or if x and y have the same ID, false otherwise.

func (*DirectedMatrix) WeightedEdge Uses

func (g *DirectedMatrix) WeightedEdge(uid, vid int64) graph.WeightedEdge

WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. The node v must be directly reachable from u as defined by the From method.

func (*DirectedMatrix) WeightedEdges Uses

func (g *DirectedMatrix) WeightedEdges() graph.WeightedEdges

WeightedEdges returns all the edges in the graph.

type Edge Uses

type Edge struct {
    F, T graph.Node
}

Edge is a simple graph edge.

func (Edge) From Uses

func (e Edge) From() graph.Node

From returns the from-node of the edge.

func (Edge) To Uses

func (e Edge) To() graph.Node

To returns the to-node of the edge.

type Node Uses

type Node int64

Node is a simple graph node.

func (Node) ID Uses

func (n Node) ID() int64

ID returns the ID number of the node.

type UndirectedGraph Uses

type UndirectedGraph struct {
    // contains filtered or unexported fields
}

UndirectedGraph implements a generalized undirected graph.

func NewUndirectedGraph Uses

func NewUndirectedGraph() *UndirectedGraph

NewUndirectedGraph returns an UndirectedGraph.

func (*UndirectedGraph) AddNode Uses

func (g *UndirectedGraph) AddNode(n graph.Node)

AddNode adds n to the graph. It panics if the added node ID matches an existing node ID.

func (*UndirectedGraph) Edge Uses

func (g *UndirectedGraph) Edge(uid, vid int64) graph.Edge

Edge returns the edge from u to v if such an edge exists and nil otherwise. The node v must be directly reachable from u as defined by the From method.

func (*UndirectedGraph) EdgeBetween Uses

func (g *UndirectedGraph) EdgeBetween(xid, yid int64) graph.Edge

EdgeBetween returns the edge between nodes x and y.

func (*UndirectedGraph) Edges Uses

func (g *UndirectedGraph) Edges() graph.Edges

Edges returns all the edges in the graph.

func (*UndirectedGraph) From Uses

func (g *UndirectedGraph) From(id int64) graph.Nodes

From returns all nodes in g that can be reached directly from n.

func (*UndirectedGraph) HasEdgeBetween Uses

func (g *UndirectedGraph) HasEdgeBetween(xid, yid int64) bool

HasEdgeBetween returns whether an edge exists between nodes x and y.

func (*UndirectedGraph) NewEdge Uses

func (g *UndirectedGraph) NewEdge(from, to graph.Node) graph.Edge

NewEdge returns a new Edge from the source to the destination node.

func (*UndirectedGraph) NewNode Uses

func (g *UndirectedGraph) NewNode() graph.Node

NewNode returns a new unique Node to be added to g. The Node's ID does not become valid in g until the Node is added to g.

func (*UndirectedGraph) Node Uses

func (g *UndirectedGraph) Node(id int64) graph.Node

Node returns the node with the given ID if it exists in the graph, and nil otherwise.

func (*UndirectedGraph) Nodes Uses

func (g *UndirectedGraph) Nodes() graph.Nodes

Nodes returns all the nodes in the graph.

func (*UndirectedGraph) RemoveEdge Uses

func (g *UndirectedGraph) RemoveEdge(fid, tid int64)

RemoveEdge removes the edge with the given end IDs from the graph, leaving the terminal nodes. If the edge does not exist it is a no-op.

func (*UndirectedGraph) RemoveNode Uses

func (g *UndirectedGraph) RemoveNode(id int64)

RemoveNode removes the node with the given ID from the graph, as well as any edges attached to it. If the node is not in the graph it is a no-op.

func (*UndirectedGraph) SetEdge Uses

func (g *UndirectedGraph) SetEdge(e graph.Edge)

SetEdge adds e, an edge from one node to another. If the nodes do not exist, they are added and are set to the nodes of the edge otherwise. It will panic if the IDs of the e.From and e.To are equal.

type UndirectedMatrix Uses

type UndirectedMatrix struct {
    // contains filtered or unexported fields
}

UndirectedMatrix represents an undirected graph using an adjacency matrix such that all IDs are in a contiguous block from 0 to n-1. Edges are stored implicitly as an edge weight, so edges stored in the graph are not recoverable.

func NewUndirectedMatrix Uses

func NewUndirectedMatrix(n int, init, self, absent float64) *UndirectedMatrix

NewUndirectedMatrix creates an undirected dense graph with n nodes. All edges are initialized with the weight given by init. The self parameter specifies the cost of self connection, and absent specifies the weight returned for absent edges.

func NewUndirectedMatrixFrom Uses

func NewUndirectedMatrixFrom(nodes []graph.Node, init, self, absent float64) *UndirectedMatrix

NewUndirectedMatrixFrom creates an undirected dense graph with the given nodes. The IDs of the nodes must be contiguous from 0 to len(nodes)-1, but may be in any order. If IDs are not contiguous NewUndirectedMatrixFrom will panic. All edges are initialized with the weight given by init. The self parameter specifies the cost of self connection, and absent specifies the weight returned for absent edges.

func (*UndirectedMatrix) Edge Uses

func (g *UndirectedMatrix) Edge(uid, vid int64) graph.Edge

Edge returns the edge from u to v if such an edge exists and nil otherwise. The node v must be directly reachable from u as defined by the From method.

func (*UndirectedMatrix) EdgeBetween Uses

func (g *UndirectedMatrix) EdgeBetween(uid, vid int64) graph.Edge

EdgeBetween returns the edge between nodes x and y.

func (*UndirectedMatrix) Edges Uses

func (g *UndirectedMatrix) Edges() graph.Edges

Edges returns all the edges in the graph.

func (*UndirectedMatrix) From Uses

func (g *UndirectedMatrix) From(id int64) graph.Nodes

From returns all nodes in g that can be reached directly from n.

func (*UndirectedMatrix) HasEdgeBetween Uses

func (g *UndirectedMatrix) HasEdgeBetween(uid, vid int64) bool

HasEdgeBetween returns whether an edge exists between nodes x and y.

func (*UndirectedMatrix) Matrix Uses

func (g *UndirectedMatrix) Matrix() mat.Matrix

Matrix returns the mat.Matrix representation of the graph.

func (*UndirectedMatrix) Node Uses

func (g *UndirectedMatrix) Node(id int64) graph.Node

Node returns the node with the given ID if it exists in the graph, and nil otherwise.

func (*UndirectedMatrix) Nodes Uses

func (g *UndirectedMatrix) Nodes() graph.Nodes

Nodes returns all the nodes in the graph.

func (*UndirectedMatrix) RemoveEdge Uses

func (g *UndirectedMatrix) RemoveEdge(fid, tid int64)

RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal nodes. If the edge does not exist it is a no-op.

func (*UndirectedMatrix) SetEdge Uses

func (g *UndirectedMatrix) SetEdge(e graph.Edge)

SetEdge sets e, an edge from one node to another with unit weight. If the ends of the edge are not in g or the edge is a self loop, SetEdge panics. SetEdge will store the nodes of e in the graph if it was initialized with NewUndirectedMatrixFrom.

func (*UndirectedMatrix) SetWeightedEdge Uses

func (g *UndirectedMatrix) SetWeightedEdge(e graph.WeightedEdge)

SetWeightedEdge sets e, an edge from one node to another. If the ends of the edge are not in g or the edge is a self loop, SetWeightedEdge panics. SetWeightedEdge will store the nodes of e in the graph if it was initialized with NewUndirectedMatrixFrom.

func (*UndirectedMatrix) Weight Uses

func (g *UndirectedMatrix) Weight(xid, yid int64) (w float64, ok bool)

Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. If x and y are the same node or there is no joining edge between the two nodes the weight value returned is either the graph's absent or self value. Weight returns true if an edge exists between x and y or if x and y have the same ID, false otherwise.

func (*UndirectedMatrix) WeightedEdge Uses

func (g *UndirectedMatrix) WeightedEdge(uid, vid int64) graph.WeightedEdge

WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. The node v must be directly reachable from u as defined by the From method.

func (*UndirectedMatrix) WeightedEdgeBetween Uses

func (g *UndirectedMatrix) WeightedEdgeBetween(uid, vid int64) graph.WeightedEdge

WeightedEdgeBetween returns the weighted edge between nodes x and y.

func (*UndirectedMatrix) WeightedEdges Uses

func (g *UndirectedMatrix) WeightedEdges() graph.WeightedEdges

WeightedEdges returns all the edges in the graph.

type WeightedDirectedGraph Uses

type WeightedDirectedGraph struct {
    // contains filtered or unexported fields
}

WeightedDirectedGraph implements a generalized weighted directed graph.

func NewWeightedDirectedGraph Uses

func NewWeightedDirectedGraph(self, absent float64) *WeightedDirectedGraph

NewWeightedDirectedGraph returns a WeightedDirectedGraph with the specified self and absent edge weight values.

func (*WeightedDirectedGraph) AddNode Uses

func (g *WeightedDirectedGraph) AddNode(n graph.Node)

AddNode adds n to the graph. It panics if the added node ID matches an existing node ID.

func (*WeightedDirectedGraph) Edge Uses

func (g *WeightedDirectedGraph) Edge(uid, vid int64) graph.Edge

Edge returns the edge from u to v if such an edge exists and nil otherwise. The node v must be directly reachable from u as defined by the From method.

func (*WeightedDirectedGraph) Edges Uses

func (g *WeightedDirectedGraph) Edges() graph.Edges

Edges returns all the edges in the graph.

func (*WeightedDirectedGraph) From Uses

func (g *WeightedDirectedGraph) From(id int64) graph.Nodes

From returns all nodes in g that can be reached directly from n.

func (*WeightedDirectedGraph) HasEdgeBetween Uses

func (g *WeightedDirectedGraph) HasEdgeBetween(xid, yid int64) bool

HasEdgeBetween returns whether an edge exists between nodes x and y without considering direction.

func (*WeightedDirectedGraph) HasEdgeFromTo Uses

func (g *WeightedDirectedGraph) HasEdgeFromTo(uid, vid int64) bool

HasEdgeFromTo returns whether an edge exists in the graph from u to v.

func (*WeightedDirectedGraph) NewNode Uses

func (g *WeightedDirectedGraph) NewNode() graph.Node

NewNode returns a new unique Node to be added to g. The Node's ID does not become valid in g until the Node is added to g.

func (*WeightedDirectedGraph) NewWeightedEdge Uses

func (g *WeightedDirectedGraph) NewWeightedEdge(from, to graph.Node, weight float64) graph.WeightedEdge

NewWeightedEdge returns a new weighted edge from the source to the destination node.

func (*WeightedDirectedGraph) Node Uses

func (g *WeightedDirectedGraph) Node(id int64) graph.Node

Node returns the node with the given ID if it exists in the graph, and nil otherwise.

func (*WeightedDirectedGraph) Nodes Uses

func (g *WeightedDirectedGraph) Nodes() graph.Nodes

Nodes returns all the nodes in the graph.

func (*WeightedDirectedGraph) RemoveEdge Uses

func (g *WeightedDirectedGraph) RemoveEdge(fid, tid int64)

RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal nodes. If the edge does not exist it is a no-op.

func (*WeightedDirectedGraph) RemoveNode Uses

func (g *WeightedDirectedGraph) RemoveNode(id int64)

RemoveNode removes the node with the given ID from the graph, as well as any edges attached to it. If the node is not in the graph it is a no-op.

func (*WeightedDirectedGraph) SetWeightedEdge Uses

func (g *WeightedDirectedGraph) SetWeightedEdge(e graph.WeightedEdge)

SetWeightedEdge adds a weighted edge from one node to another. If the nodes do not exist, they are added and are set to the nodes of the edge otherwise. It will panic if the IDs of the e.From and e.To are equal.

func (*WeightedDirectedGraph) To Uses

func (g *WeightedDirectedGraph) To(id int64) graph.Nodes

To returns all nodes in g that can reach directly to n.

func (*WeightedDirectedGraph) Weight Uses

func (g *WeightedDirectedGraph) Weight(xid, yid int64) (w float64, ok bool)

Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. If x and y are the same node or there is no joining edge between the two nodes the weight value returned is either the graph's absent or self value. Weight returns true if an edge exists between x and y or if x and y have the same ID, false otherwise.

func (*WeightedDirectedGraph) WeightedEdge Uses

func (g *WeightedDirectedGraph) WeightedEdge(uid, vid int64) graph.WeightedEdge

WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. The node v must be directly reachable from u as defined by the From method.

func (*WeightedDirectedGraph) WeightedEdges Uses

func (g *WeightedDirectedGraph) WeightedEdges() graph.WeightedEdges

WeightedEdges returns all the weighted edges in the graph.

type WeightedEdge Uses

type WeightedEdge struct {
    F, T graph.Node
    W    float64
}

WeightedEdge is a simple weighted graph edge.

func (WeightedEdge) From Uses

func (e WeightedEdge) From() graph.Node

From returns the from-node of the edge.

func (WeightedEdge) To Uses

func (e WeightedEdge) To() graph.Node

To returns the to-node of the edge.

func (WeightedEdge) Weight Uses

func (e WeightedEdge) Weight() float64

Weight returns the weight of the edge.

type WeightedUndirectedGraph Uses

type WeightedUndirectedGraph struct {
    // contains filtered or unexported fields
}

WeightedUndirectedGraph implements a generalized weighted undirected graph.

func NewWeightedUndirectedGraph Uses

func NewWeightedUndirectedGraph(self, absent float64) *WeightedUndirectedGraph

NewWeightedUndirectedGraph returns an WeightedUndirectedGraph with the specified self and absent edge weight values.

func (*WeightedUndirectedGraph) AddNode Uses

func (g *WeightedUndirectedGraph) AddNode(n graph.Node)

AddNode adds n to the graph. It panics if the added node ID matches an existing node ID.

func (*WeightedUndirectedGraph) Edge Uses

func (g *WeightedUndirectedGraph) Edge(uid, vid int64) graph.Edge

Edge returns the edge from u to v if such an edge exists and nil otherwise. The node v must be directly reachable from u as defined by the From method.

func (*WeightedUndirectedGraph) EdgeBetween Uses

func (g *WeightedUndirectedGraph) EdgeBetween(xid, yid int64) graph.Edge

EdgeBetween returns the edge between nodes x and y.

func (*WeightedUndirectedGraph) Edges Uses

func (g *WeightedUndirectedGraph) Edges() graph.Edges

Edges returns all the edges in the graph.

func (*WeightedUndirectedGraph) From Uses

func (g *WeightedUndirectedGraph) From(id int64) graph.Nodes

From returns all nodes in g that can be reached directly from n.

func (*WeightedUndirectedGraph) HasEdgeBetween Uses

func (g *WeightedUndirectedGraph) HasEdgeBetween(xid, yid int64) bool

HasEdgeBetween returns whether an edge exists between nodes x and y.

func (*WeightedUndirectedGraph) NewNode Uses

func (g *WeightedUndirectedGraph) NewNode() graph.Node

NewNode returns a new unique Node to be added to g. The Node's ID does not become valid in g until the Node is added to g.

func (*WeightedUndirectedGraph) NewWeightedEdge Uses

func (g *WeightedUndirectedGraph) NewWeightedEdge(from, to graph.Node, weight float64) graph.WeightedEdge

NewWeightedEdge returns a new weighted edge from the source to the destination node.

func (*WeightedUndirectedGraph) Node Uses

func (g *WeightedUndirectedGraph) Node(id int64) graph.Node

Node returns the node with the given ID if it exists in the graph, and nil otherwise.

func (*WeightedUndirectedGraph) Nodes Uses

func (g *WeightedUndirectedGraph) Nodes() graph.Nodes

Nodes returns all the nodes in the graph.

func (*WeightedUndirectedGraph) RemoveEdge Uses

func (g *WeightedUndirectedGraph) RemoveEdge(fid, tid int64)

RemoveEdge removes the edge with the given end point IDs from the graph, leaving the terminal nodes. If the edge does not exist it is a no-op.

func (*WeightedUndirectedGraph) RemoveNode Uses

func (g *WeightedUndirectedGraph) RemoveNode(id int64)

RemoveNode removes the node with the given ID from the graph, as well as any edges attached to it. If the node is not in the graph it is a no-op.

func (*WeightedUndirectedGraph) SetWeightedEdge Uses

func (g *WeightedUndirectedGraph) SetWeightedEdge(e graph.WeightedEdge)

SetWeightedEdge adds a weighted edge from one node to another. If the nodes do not exist, they are added and are set to the nodes of the edge otherwise. It will panic if the IDs of the e.From and e.To are equal.

func (*WeightedUndirectedGraph) Weight Uses

func (g *WeightedUndirectedGraph) Weight(xid, yid int64) (w float64, ok bool)

Weight returns the weight for the edge between x and y if Edge(x, y) returns a non-nil Edge. If x and y are the same node or there is no joining edge between the two nodes the weight value returned is either the graph's absent or self value. Weight returns true if an edge exists between x and y or if x and y have the same ID, false otherwise.

func (*WeightedUndirectedGraph) WeightedEdge Uses

func (g *WeightedUndirectedGraph) WeightedEdge(uid, vid int64) graph.WeightedEdge

WeightedEdge returns the weighted edge from u to v if such an edge exists and nil otherwise. The node v must be directly reachable from u as defined by the From method.

func (*WeightedUndirectedGraph) WeightedEdgeBetween Uses

func (g *WeightedUndirectedGraph) WeightedEdgeBetween(xid, yid int64) graph.WeightedEdge

WeightedEdgeBetween returns the weighted edge between nodes x and y.

func (*WeightedUndirectedGraph) WeightedEdges Uses

func (g *WeightedUndirectedGraph) WeightedEdges() graph.WeightedEdges

WeightedEdges returns all the weighted edges in the graph.

Package simple imports 8 packages (graph) and is imported by 33 packages. Updated 2018-11-22. Refresh now. Tools for package owners.