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.
Previously there was an attempt to maintain some kind of semantic ordering,
but given the needed complexity of the API this has become untenable. So
just order according to the Godoc — alphabetical for exported methods and
functions. For unexported functions, use judgement.
One method, Has on multi.DirectedGraph, that should not have been present is
deleted.
This changes the behaviour of the function to create the small world graph as
a disconnected subgraph in g rather than applying the algorithm to potentially
already existing nodes in g.
This changes the behaviour of the function to create the small world graph as
a disconnected subgraph in g rather than applying the algorithm to potentially
already existing nodes in g.
This changes the behaviour of the function to create the Gnm and Gnp graphs as
disconnected subgraphs in g rather than applying the algorithm to potentially
already existing nodes in g.
This changes the behaviour of the function to create the scale free graph as
a disconnected subgraph in g rather than applying the algorithm to potentially
already existing nodes in g.
This was largely written by aqwari.net/xml/cmd/xsdgen working on the XSD
files available from the gephy/gexf specs repository[1], with some help;
the specs use includes which cause xsdgen to fail, so I manually
in-lined the includes.
The generated code was then edited to make optional attributes exist on
pointers, to reduce the length of labels to within reasonably normal Go
idiom and removing unnecessary namespacing.
The package is versioned since the format appears to arbitrarily be
updated.
[1]81ba4e7ccd/specs/1.2draft
With the approach to graph node mutation on edge setting the previously
existed there was an issue that the edge last used connect a pair of
nodes could result in a difference in the nodes being returned by a node
query compared to the same node associated with edges returned from an
edge query.
This change avoids dealing with that by making it implementation
dependent and stating this, and by making all the node-storing graphs
we provide mutate the nodes when edges are set.
The only call to Has for johnsonWeightAdjuster is in the preamble to
BellmanFordFor, which is always passed the known query node. If Has is
called when the graph is not in the Bellman-Ford mode or the Has query
is not the query node, the call was invalid and we should panic.
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.