Documentation ¶
Overview ¶
*
- Package graph implements a Graph that can be either a King's graph
- or a Grid graph. It can generate a graph from a given image.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Edge ¶
type Edge struct {
// contains filtered or unexported fields
}
*
- Represents a graph edge. It contains the ids of the two vertices
- that it connects and the weight of the edge between them
type EdgeList ¶
type EdgeList []Edge
*
- Used to store all the edges that the graph contains.
- It can be used with sort.Sort
type Graph ¶
type Graph struct {
// contains filtered or unexported fields
}
*
- Graph datatype. Contains a list of edges, the graph width and height and
- if it's a King's graph or a Grid graph
func FromImage ¶
*
- Returns a new graph that represents the image img. The graph will be either
- a King's grph or a Grid graph. It will compute the edge weights using the
- provided function weight.
func New ¶
*
- Returns a new width x height King's or Grid graph. It assigns a weight of Infinity
- to all edges
Click to show internal directories.
Click to hide internal directories.