graph/multi: use more efficient and correct direction dedup logic

Also add test case to testgraph corpus.
3 files changed
tree: eccf058afc2cbd060554b534a853a2c31f0b182a
  1. .github/
  2. .travis/
  3. blas/
  4. cmplxs/
  5. diff/
  6. dsp/
  7. floats/
  8. graph/
  9. integrate/
  10. internal/
  11. interp/
  12. lapack/
  13. mat/
  14. mathext/
  15. num/
  16. optimize/
  17. spatial/
  18. stat/
  20. unit/
  21. .codecov.yml
  22. .travis.yml
  23. appveyor.yml
  28. doc.go
  29. go.mod
  30. go.sum
  31. GOPHER
  32. gopher.png
  33. gopher.svg
  36. version.go


Build status Build Status Build status reference GoDoc Go Report Card stability-unstable


The core packages of the Gonum suite are written in pure Go with some assembly. Installation is done using go get.

go get -u

Supported Go versions

Gonum supports and tests using the gc compiler on the two most recent Go releases on Linux (386, amd64 and arm64), macOS and Windows (both on amd64).

Release schedule

The Gonum modules are released on a six-month release schedule, aligned with the Go releases. i.e.: when Go-1.x is released, Gonum-v0.n.0 is released around the same time. Six months after, Go-1.x+1 is released, and Gonum-v0.n+1.0 as well.

The release schedule, based on the current Go release schedule is thus:

  • Gonum-v0.n.0: February
  • Gonum-v0.n+1.0: August

Build tags

The Gonum packages use a variety of build tags to set non-standard build conditions. Building Gonum applications will work without knowing how to use these tags, but they can be used during testing and to control the use of assembly and CGO code.

The current list of non-internal tags is as follows:

  • safe — do not use assembly or unsafe
  • bounds — use bounds checks even in internal calls
  • cblas — use CGO BLAS implementation in tests (only in mat package)
  • noasm — do not use assembly implementations
  • tomita — use Tomita, Tanaka, Takahashi pivot choice for maximimal clique calculation, otherwise use random pivot (only in topo package)

Issues TODOs

If you find any bugs, feel free to file an issue on the github issue tracker. Discussions on API changes, added features, code review, or similar requests are preferred on the gonum-dev Google Group.!forum/gonum-dev


Original code is licensed under the Gonum License found in the LICENSE file. Portions of the code are subject to the additional licenses found in THIRD_PARTY_LICENSES. All third party code is licensed either under a BSD or MIT license.

Code in graph/formats/dot is dual licensed Public Domain Dedication and Gonum License, and users are free to choose the license which suits their needs for this code.

The W3C test suites in graph/formats/rdf are distributed under both the W3C Test Suite License and the W3C 3-clause BSD License.