Commit Graph

15 Commits

Author SHA1 Message Date
Dan Kortschak
d8ad7756b6 all: fix spelling and typos 2022-03-14 21:32:06 +10:30
Dan Kortschak
8f6a7707f4 graph/internal/ordered: replace slice sort types with sort.Slice calls 2021-10-14 07:01:58 +10:30
Dan Kortschak
a6ddba7f8d graph/{multi,simple,testgraph}: add support for ID-specified node addition 2021-03-16 09:37:18 +10:30
Dan Kortschak
84c458a64e graph/{multi,testgraph}: make line ID allocation per node pair 2020-12-19 21:14:24 +10:30
Dan Kortschak
db381b03c0 graph/{multi,simple,testgraph}: fix edge reversal tests and multi.WeightUndirected
This also adds the option for not testing edge reversal.
2020-12-19 21:14:24 +10:30
Dan Kortschak
0e6fb8d22a all: use scalar.Same instead of local same function 2020-08-07 07:59:02 +09:30
Dan Kortschak
142f1a8c6b graph: make graph analysis routines safe for indeterminate iterators
This is a change in design for the graph.NodesOf family of functions. The
alternative was to provide an equivalent set of non-panicking routines in
graph for internal use. The protection that was intended with the panic
was to panic early rather than late when an indeterminate iterator exhausts
slice index space. I think in hindsight this was an error and we should
let things blow up in that (likely rare) situation.

The majority of changes are in test code. Outside the iterator package, which
is intimately tied to the determined iterator implementations, only one test
now fails if an indeterminate iterator is used, product's Modular extended
sub-graph isomorphism example, which is an algorithm that would have time
complexity issues with large iterators anyway.
2020-07-02 07:47:46 +09:30
Dan Kortschak
b34a300801 all: fix capitalisation of Gonum
This fixes the capitalisation of Gonum where it refers to the project rather
than the GitHub organisation or repository. The text of CONTRIBUTORS also
is fixed to reflect the reality that contributors may have contributed to
other repositories within the project.
2019-11-16 21:25:28 +10:30
Dan Kortschak
3129c79de2 graph/testgraph: test for missing From and To paths 2019-07-25 07:03:54 +09:30
Dan Kortschak
9182d211c6 graph/internal/set: make Nodes creation a function
This allows us to alter the type that is returned and the
underlying implementation if necessary.
2019-03-14 20:54:06 +10:30
Dan Kortschak
761876748e graph: make edges and lines reversible 2019-03-13 07:14:55 +10:30
Dan Kortschak
f0541c62aa graph/{multi,simple,testgraph}: extend edge testing
Fix bug found in weighted multigraphs found by addition of line and edge
testing breadth.
2019-02-10 06:51:37 +10:30
Dan Kortschak
0ddfc886b7 graph/testgraph: add mutation tests 2019-02-01 08:51:46 +10:30
Dan Kortschak
14c7f9569f graph: add Empty universal iterator for empty returns 2018-12-22 09:59:24 +10:30
Dan Kortschak
a8f1562992 graph/testgraph: new package for testing graph implementations
Currently variant line types do not work the same way as they would with
a slice of edges because access to a []graph.Edge also allows the
elements of that slice can be type asserted to richer types like
graph.Line or graph.WeightedEdge for example. This cannot be done with
the API as is stands with the iterator-holding edge being down graded
from one of the richer types.
The problem can be avoided by either making graph.WeightedLines also
satisfy graph.Lines (same for edges), or by down-typing the edges in the
non-weighted edge return methods for the graph implemetations.
2018-11-21 11:35:03 +10:30