## package digraph6

`import "gonum.org/v1/gonum/graph/encoding/digraph6"`

Package digraph6 implements graphs specified by digraph6 strings.

### Index ¶

- func IsValid(g Graph) bool
- type Graph
- func Encode(g graph.Graph) Graph
- func (g Graph) Edge(uid, vid int64) graph.Edge
- func (g Graph) From(id int64) graph.Nodes
- func (g Graph) GoString() string
- func (g Graph) HasEdgeBetween(xid, yid int64) bool
- func (g Graph) HasEdgeFromTo(uid, vid int64) bool
- func (g Graph) Node(id int64) graph.Node
- func (g Graph) Nodes() graph.Nodes
- func (g Graph) To(id int64) graph.Nodes

### Functions ¶

#### func IsValid ¶

IsValid returns whether the graph is a valid digraph6 encoding. An invalid Graph behaves as the null graph.

### Types ¶

#### type Graph ¶

type Graph string

Graph is a digraph6-represented directed graph.

See https://users.cecs.anu.edu.au/~bdm/data/formats.txt for details.

Note that the digraph6 format specifies that the first character of the graph string is a '&'. This character must be present for use in the digraph6 package. A Graph without this prefix is treated as the null graph.

#### func Encode ¶

Encode returns a graph6 encoding of the topology of the given graph using a lexical ordering of the nodes by ID to map them to [0, n).

#### func (Graph) Edge ¶

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

#### func (Graph) From ¶

From returns all nodes that can be reached directly from the node with the given ID.

#### func (Graph) GoString ¶

#### func (Graph) HasEdgeBetween ¶

HasEdgeBetween returns whether an edge exists between nodes with IDs xid and yid without considering direction.

#### func (Graph) HasEdgeFromTo ¶

HasEdgeFromTo returns whether an edge exists in the graph from u to v with IDs uid and vid.

#### func (Graph) Node ¶

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

#### func (Graph) Nodes ¶

Nodes returns all the nodes in the graph.

#### func (Graph) To ¶

To returns all nodes that can reach directly to the node with the given ID.

### Source Files ¶

digraph6.go

- Version
- v0.14.0 (latest)
- Published
- Aug 19, 2023
- Platform
- linux/amd64
- Imports
- 7 packages
- Last checked
- 4 hours ago –

Tools for package owners.