Commit Graph

21 Commits

Author SHA1 Message Date
Dan Kortschak
876d8ff682 graph/traverse: fix depth first traversal order and tighten tests 2021-03-24 22:12:47 +10:30
Vladimir Chalupecky
c38fb5f9ef all: fix "the the" typo in comments 2019-03-28 14:24:03 +01:00
Dan Kortschak
e42c1265cd graph/traverse: reduce edge visiting/traversal confusion
The Visit function was originally intended to allow the user to visit nodes
with an understanding of the path which edge was used to reach the node. This
was misguided because it implies the existence of an invariant that does not
exist; every edge into a node is passed to Visit as its node end points. This
does not happen because Visit is only called after the node being traverse to
is tested for having been visited, leading to surprising behaviour. So this
change makes Visit only consider the visited node.

The function that was originally intended to be provided by Visit is not given
by the Traverse function — previously EdgeFilter — which is called prior to
the node's visited status test. The node's visited status can be determined
via the walker's Visited method if needed. To avoid painting the edge visiting
method as purely a filter, it is renamed Traverse.
2019-03-26 07:41:45 +10:30
Dan Kortschak
b73a2c92ff graph: add node, edge and line iterators 2018-09-23 09:25:56 +09:30
Dan Kortschak
22552cc6f1 traverse: relax requirements for traversal types
This is special cased because simple graph traversal is generally useful
and users my want to be able to travers graph-like types without
implementing all the methods on graph.Graph.
2018-05-09 07:30:30 +09:30
Dan Kortschak
6b03bc22e1 graph: use int64 for node retrieval 2018-03-24 09:21:44 +10:30
kortschak
805531d142 all: change capitalization of gonum in license header 2017-11-02 06:54:08 +10:30
mewmew
7e53ef2fae all: use fixdocs tool to store package documentation in doc.go
Add copyright header to doc.go

Keep original comment style (e.g. line comments and block comments).

Fix doc comments containing multiple line comments.

Remove vanity imports from all files except doc.go.

Fixes #12.

The source code of fixdocs is located at:
https://play.golang.org/p/7RtYLzldsO
2017-08-16 14:26:00 +02:00
mewmew
ac48587c92 Revert "all: use fixdocs tool to store package documentation in doc.go"
This reverts commit b2982a3e50.
2017-08-16 14:21:05 +02:00
mewmew
b2982a3e50 all: use fixdocs tool to store package documentation in doc.go
Add copyright header to doc.go

Keep original comment style (e.g. line comments and block comments).

Fix doc comments containing multiple line comments.
2017-08-16 14:07:36 +02:00
mewmew
5b4711aa15 Revert "all: use fixdocs tool to store package documentation in doc.go"
This reverts commit b0a98102dc.
2017-08-16 14:07:17 +02:00
mewmew
b0a98102dc all: use fixdocs tool to store package documentation in doc.go
Add copyright header to doc.go

Keep original comment style (e.g. line comments and block comments).
2017-08-16 14:02:26 +02:00
mewmew
7eaea7c428 Revert "all: use fixdocs tool to store package documentation in doc.go"
This reverts commit 00292b2d57.
2017-08-16 14:01:36 +02:00
mewmew
00292b2d57 all: use fixdocs tool to store package documentation in doc.go
Add copyright header to doc.go
2017-08-16 13:56:50 +02:00
mewmew
a37fef5a6d Revert "all: use fixdocs tool to store package documentation in doc.go"
This reverts commit 963877e5f5.
2017-08-16 13:54:16 +02:00
mewmew
963877e5f5 all: use fixdocs tool to store package documentation in doc.go 2017-08-16 13:19:00 +02:00
kortschak
d36956e8e0 graph/traverse: update for int64 IDs 2017-07-02 08:38:42 +09:30
kortschak
619e137c2c graph,graph/{encoding/dot,internal/set,topo,traverse}: remove intsets imports 2017-06-16 19:39:51 +09:30
kortschak
37850ca814 all: add canonical imports 2017-05-25 16:07:18 +09:30
Brendan Tracey
d33397aa65 all: change import paths 2017-05-23 00:03:03 -06:00
Brendan Tracey
059a6c43f9 graph: imported graph as a subtree 2017-05-23 00:02:59 -06:00