struct::graph(3tcl)
okay so this is struct::graph(3tcl) from the Tcl Data Structures manual, and bestie, it's giving directed graph energy πβ¨
π NAME π
struct::graph β Create and manipulate directed graph objects π
β¨ SYNOPSIS β¨
package require Tcl 8.5 9
package require struct::graph ?2.4.4?
package require struct::list ?1.8.6?
package require struct::set ?2.2.4?
::struct::graph ?graphName? ?=|:=|as|deserialize source?
graphName option ?arg arg ...?
graphName = sourcegraph
graphName --> destgraph
graphName append key value
graphName deserialize serialization
graphName destroy
graphName arc append arc key value
graphName arc attr key
graphName arc attr key -arcs list
graphName arc attr key -glob globpattern
graphName arc attr key -regexp repattern
graphName arc delete arc ?arc ...?
graphName arc exists arc
graphName arc flip arc
graphName arc get arc key
graphName arc getall arc ?pattern?
graphName arc getunweighted
graphName arc getweight arc
graphName arc keys arc ?pattern?
graphName arc keyexists arc key
graphName arc insert start end ?child?
graphName arc lappend arc key value
graphName arc rename arc newname
graphName arc set arc key ?value?
graphName arc setunweighted ?weight?
graphName arc setweight arc weight
graphName arc unsetweight arc
graphName arc hasweight arc
graphName arc source arc
graphName arc target arc
graphName arc nodes arc
graphName arc move-source arc newsource
graphName arc move-target arc newtarget
graphName arc move arc newsource newtarget
graphName arc unset arc key
graphName arc weights
graphName arcs ?-key key? ?-value value? ?-filter cmdprefix?
?-in|-out|-adj|-inner|-embedding node node...?
graphName lappend key value
graphName node append node key value
graphName node attr key
graphName node attr key -nodes list
graphName node attr key -glob globpattern
graphName node attr key -regexp repattern
graphName node degree ?-in|-out? node
graphName node delete node ?node...?
graphName node exists node
graphName node get node key
graphName node getall node ?pattern?
graphName node keys node ?pattern?
graphName node keyexists node key
graphName node insert ?node...?
graphName node lappend node key value
graphName node opposite node arc
graphName node rename node newname
graphName node set node key ?value?
graphName node unset node key
graphName nodes ?-key key? ?-value value? ?-filter cmdprefix?
?-in|-out|-adj|-inner|-embedding node node...?
graphName get key
graphName getall ?pattern?
graphName keys ?pattern?
graphName keyexists key
graphName serialize ?node...?
graphName set key ?value?
graphName swap node1 node2
graphName unset key
graphName walk node ?-order order? ?-type type? ?-dir direction?
-command cmd
πΈ DESCRIPTION πΈ
so a directed graph is literally a structure with two collections of elements β nodes and arcs β plus a relation (the "connectivity") that puts a general structure on the nodes and arcs π¦
each arc is connected to two nodes: one is the source and the other is the target. that's what imposes a direction on the arc, and we say it goes from the source to the target. it is allowed that source and target of an arc are the same node β that kind of arc is called a loop π. whenever a node is either the source or target of an arc, both are said to be adjacent. this extends into a relation between nodes, i.e. if two nodes are connected through at least one arc they are said to be adjacent too π«
each node can be the source and target for any number of arcs. the former are called the outgoing arcs of the node, the latter the incoming arcs of the node. the number of arcs in either set is called the in-degree resp. the out-degree of the node π
in addition to maintaining the node and arc relationships, this graph implementation allows any number of named attributes to be associated with the graph itself, and each node or arc β¨
Note: The major version of the package struct has been changed to version 2.0, due to backward incompatible changes in the API of this module. Please read the section Changes for 2.0 for a full list of all changes, incompatible and otherwise. π
Note: A C-implementation of the command can be had from the locationhttp://www.purl.org/NET/schlenker/tcl/cgraph. See alsohttp://wiki.tcl.tk/cgraph. This implementation uses a bit less memory than the tcl version provided here directly, and is faster. Its support is limited to versions of the package before 2.0. π
as of version 2.2 of this package a critcl based C implementation is available from here as well. This implementation however requires Tcl 8.4 to run π
the main command of the package is:
::struct::graph ?graphName? ?=|:=|as|deserialize source?β The command creates a new graph object with an associated global Tcl command whose name is graphName. This command may be used to invoke various operations on the graph. It has the following general form:
graphName option ?arg arg ...?
Option and the args determine the exact behavior of the command π«Ά
if graphName is not specified a unique name will be generated by the package itself. If a source is specified the new graph will be initialized to it. For the operators =, :=, and as the source argument is interpreted as the name of another graph object, and the assignment operator = will be executed. For the operator deserialize the source is a serialized graph object and deserialize will be executed π
in other words
::struct::graph mygraph = b
is equivalent to
::struct::graph mygraph
mygraph = b
and
::struct::graph mygraph deserialize $b
is equivalent to
::struct::graph mygraph
mygraph deserialize $b
the following commands are possible for graph objects:
graphName = sourcegraphβ This is the assignment operator for graph objects. It copies the graph contained in the graph object sourcegraph over the graph data in graphName. The old contents of graphName are deleted by this operation π
This operation is in effect equivalent to
graphName deserialize [sourcegraph serialize]
The operation assumes that the sourcegraph provides the method serialize and that this method returns a valid graph serialization π
graphName --> destgraphβ This is the reverse assignment operator for graph objects. It copies the graph contained in the graph object graphName over the graph data in the object destgraph. The old contents of destgraph are deleted by this operation π¦
This operation is in effect equivalent to
destgraph deserialize [graphName serialize]
The operation assumes that the destgraph provides the method deserialize and that this method takes a graph serialization β¨
graphName append key valueβ Appends a value to one of the keyed values associated with the graph. Returns the new value given to the attribute key πgraphName deserialize serializationβ This is the complement toserialize. It replaces the graph data in graphName with the graph described by the serialization value. The old contents of graphName are deleted by this operation πgraphName destroyβ Destroys the graph, including its storage space and associated command πgraphName arc append arc key valueβ Appends a value to one of the keyed values associated with an arc. Returns the new value given to the attribute key πΈgraphName arc attr keygraphName arc attr key -arcs listgraphName arc attr key -glob globpatterngraphName arc attr key -regexp repatternβ This method retrieves the value of the attribute named key, for all arcs in the graph (matching the restriction specified via one of the possible options) and having the specified attribute π«Ά
The result is a dictionary mapping from arc names to the value of attribute key at that arc. Arcs not having the attribute key, or not passing a specified restriction, are not listed in the result π
The possible restrictions are:
-arcsβ The value is a list of arcs. Only the arcs mentioned in this list are searched for the attribute.-globβ The value is a glob pattern. Only the arcs in the graph whose names match this pattern are searched for the attribute.-regexpβ The value is a regular expression. Only the arcs in the graph whose names match this pattern are searched for the attribute.
graphName arc delete arc ?arc ...?β Remove the specified arcs from the graph ποΈgraphName arc exists arcβ Return true if the specified arc exists in the graph βgraphName arc flip arcβ Reverses the direction of the named arc, i.e. the source and target nodes of the arc are exchanged with each other πgraphName arc get arc keyβ Returns the value associated with the key key for the arc πgraphName arc getall arc ?pattern?β Returns a dictionary (suitable for use with[array set]) for the arc. If the pattern is specified only the attributes whose names match the pattern will be part of the returned dictionary. The pattern is a glob pattern πgraphName arc getunweightedβ Returns a list containing the names of all arcs in the graph which have no weight associated with them βοΈgraphName arc getweight arcβ Returns the weight associated with the arc. Throws an error if the arc has no weight associated with it πgraphName arc keys arc ?pattern?β Returns a list of keys for the arc. If the pattern is specified only the attributes whose names match the pattern will be part of the returned list. The pattern is a glob pattern πgraphName arc keyexists arc keyβ Return true if the specified key exists for the arc πgraphName arc insert start end ?child?β Insert an arc named child into the graph beginning at the node start and ending at the node end. If the name of the new arc is not specified the system will generate a unique name of the formarcxπ
graphName arc lappend arc key value
okay bestie, this one appends a value β and yes, itβs a list, we love that for us β to one of the keyed values hanging out with an arc. It gives you back the new value that got assigned to that attribute key. slay. π
graphName arc rename arc newname
Renames the arc arc to newname. An error is thrown if either the arc does not exist, or an arc with name newname does exist. The result of the command is the new name of the arc. no cap, itβs giving βglow up but make it structural.β β¨
graphName arc set arc key ?value?
Set or get one of the keyed values associated with an arc. An arc may have any number of keyed values associated with it. If value is not specified, this command returns the current value assigned to the key; if value is specified, this command assigns that value to the key, and returns that value. itβs literally the βchoose your own adventureβ of attributes. π¦
graphName arc setunweighted ?weight?
Sets the weight of all arcs without a weight to weight. Returns the empty string as its result. If not present weight defaults to 0. lowkey the default is zero, so if you forget, thatβs on you bestie. π
graphName arc setweight arc weight
Sets the weight of the arc to weight. Returns weight. thatβs it, thatβs the whole vibe. πΈ
graphName arc unsetweight arc
Removes the weight of the arc, if present. Does nothing otherwise. Returns the empty string. itβs giving βghosted, but politely.β π
graphName arc hasweight arc
Determines if the arc has a weight associated with it. The result is a boolean value, True if a weight is defined, and False otherwise. vibe check: does it have the weight? yes or no, periodt. β
graphName arc source arc
Return the node the given arc begins at. the origin story, if you will. π
graphName arc target arc
Return the node the given arc ends at. the destination, the final boss, the main character energy. π
graphName arc nodes arc
Return the nodes the given arc begins and ends at, as a two-element list. both ends of the slay, together at last. π«Ά
graphName arc move-source arc newsource
Changes the source node of the arc to newsource. It can be said that the arc rotates around its target node. so itβs pivoting, but make it graph theory. π₯
graphName arc move-target arc newtarget
Changes the target node of the arc to newtarget. It can be said that the arc rotates around its source node. same energy, different end. π
graphName arc move arc newsource newtarget
Changes both source and target nodes of the arc to newsource, and newtarget resp. full send, no half measures. π
graphName arc unset arc key
Remove a keyed value from the arc arc. The method will do nothing if the key does not exist. itβs the βif you know, you knowβ of deletion β if itβs not there, no drama. iykyk. π€«
graphName arc weights
Returns a dictionary whose keys are the names of all arcs which have a weight associated with them, and the values are these weights. a little dictionary of heavy hitters, if you will. π
graphName arcs ?-key key? ?-value value? ?-filter cmdprefix? ?-in|-out|-adj|-inner|-embedding node node...?
okay so this one returns a list of arcs in the graph. If no restriction is specified, a list containing all arcs is returned. Restrictions can limit the list of returned arcs based on the nodes that are connected by the arc, on the keyed values associated with the arc, or both. A general filter command can be used as well. The restrictions that involve connected nodes take a variable number of nodes as argument, specified after the name of the restriction itself.
The restrictions imposed by either -in, -out, -adj, -inner, or -embedding are applied first. Specifying more than one of them is illegal.
After that, the restrictions set via -key (and -value) are applied. Specifying more than one -key (and -value) is illegal. Specifying -value alone, without -key, is illegal as well.
Any restriction set through -filter is applied last. Specifying more than one -filter is illegal.
Coming back to the restrictions based on a set of nodes, the command recognizes the following switches:
-inβ Return a list of all arcs whose target is one of the nodes in the set of nodes. I.e. it computes the union of all incoming arcs of the nodes in the set.-outβ Return a list of all arcs whose source is one of the nodes in the set of nodes. I.e. it computes the union of all outgoing arcs of the nodes in the set.-adjβ Return a list of all arcs adjacent to at least one of the nodes in the set. This is the union of the nodes returned by-inand-out.-innerβ Return a list of all arcs which are adjacent to two of the nodes in the set. This is the set of arcs in the subgraph spawned by the specified nodes.-embeddingβ Return a list of all arcs adjacent to exactly one of the nodes in the set. This is the set of arcs connecting the subgraph spawned by the specified nodes to the rest of the graph.
Attention: After the above options any word with a leading dash which is not a valid option is treated as a node name instead of an invalid option to error out on. This condition holds until either a valid option terminates the list of nodes, or the end of the command is reached, whichever comes first.
The remaining filter options are:
-key keyβ Limit the list of arcs that are returned to those arcs that have an associated keykey.-value valueβ This restriction can only be used in combination with-key. It limits the list of arcs that are returned to those arcs whose associated keykeyhas the valuevalue.-filter cmdrefixβ Limit the list of arcs that are returned to those arcs that pass the test. The command incmdprefixis called with two arguments, the name of the graph object, and the name of the arc in question. It is executed in the context of the caller and has to return a boolean value. Arcs for which the command returnsfalseare removed from the result list before it is returned to the caller.
graphName lappend key value
Appends a value (as a list) to one of the keyed values associated with the graph. Returns the new value given to the attribute key. the graph itself is getting the list treatment, and honestly? iconic. β¨
graphName node append node key value
Appends a value to one of the keyed values associated with an node. Returns the new value given to the attribute key. notice it says βan nodeβ β the original said it, not me, but we still love the chaos. π
graphName node attr key / graphName node attr key -nodes list / graphName node attr key -glob globpattern / graphName node attr key -regexp repattern
graphName node attr key
graphName node attr key -nodes list
graphName node attr key -glob globpattern
graphName node attr key -regexp repattern
This method retrieves the value of the attribute named key, for all nodes in the graph (matching the restriction specified via one of the possible options) and having the specified attribute.
The result is a dictionary mapping from node names to the value of attribute key at that node. Nodes not having the attribute key, or not passing a specified restriction, are not listed in the result.
The possible restrictions are:
-nodesβ The value is a list of nodes. Only the nodes mentioned in this list are searched for the attribute.-globβ The value is a glob pattern. Only the nodes in the graph whose names match this pattern are searched for the attribute.-regexpβ The value is a regular expression. Only the nodes in the graph whose names match this pattern are searched for the attribute.
itβs giving βfind the vibe, but for attributes.β π§
graphName node degree ?-in|-out? node
Return the number of arcs adjacent to the specified node. If one of the restrictions -in or -out is given only the incoming resp. outgoing arcs are counted. so itβs the popularity contest, but with math. π
graphName node delete node ?node...?
Remove the specified nodes from the graph. All of the nodes' arcs will be removed as well to prevent unconnected arcs. no orphaned arcs on our watch, bestie. π«
graphName node exists node
Return true if the specified node exists in the graph. simple, clean, existential. π¦
graphName node get node key
Return the value associated with the key key for the node. just a little peek behind the curtain. π
graphName node getall node ?pattern?
Returns a dictionary (suitable for use with [array set]) for the node. If the pattern is specified only the attributes whose names match the pattern will be part of the returned dictionary. The pattern is a glob pattern. the whole squad of attributes, assembled. π
graphName node keys node ?pattern?
Returns a list of keys for the node. If the pattern is specified only the attributes whose names match the pattern will be part of the returned list. The pattern is a glob pattern. just the names, no values, very mysterious. π
graphName node keyexists node key
Return true if the specified key exists for the node. the βdoes this key even go hereβ check. π
graphName node insert ?node...?
Insert one or more nodes into the graph. The new nodes have no arcs connected to them. If no node is specified one node will be inserted, and the system will generate a unique name of the form nodex for it. so if youβre feeling lazy, the system will name it nodex and honestly? valid. β¨
graphName node lappend node key value
Appends a value (as a list) to one of the keyed values associated with an node. Returns the new value given to the attribute key. again with the βan nodeβ β we keep it exactly as the original said, because rules are rules. π
graphName node opposite node arc
Return the node at the other end of the specified arc, which has to be adjacent to the given node. the βwhoβs on the other side of this connectionβ reveal. π
graphName node rename node newname
Renames the node node to newname. An error is thrown if either the node does not exist, or a node with name newname does exist. The result of the command is the new name of the node. name change, but make it official. π
graphName node set node key ?value?
Set or get one of the keyed values associated with a node. A node may have any number of keyed values associated with it. If value is not specified, this command returns the current value assigned to the key; if value is specified, this command assigns that value to the key. the nodeβs personalization era. πΈ
graphName node unset node key
Remove a keyed value from the node node. The method will do nothing if the key does not exist. ghosting the key, but with zero consequences. π
graphName nodes ?-key key? ?-value value? ?-filter cmdprefix? ?-in|-out|-adj|-inner|-embedding node node...?
Return a list of nodes in the graph. Restrictions can limit the list of returned nodes based on neighboring nodes, or based on the keyed values associated with the node. The restrictions that involve neighboring nodes have a list of nodes as argument, specified after the name of the restriction itself.
The possible restrictions are the same as for method arcs. Note that while the exact meanings change slightly, as they operate on nodes instead of arcs, the general behaviour is the same, especially when it comes to the handling of words with a leading dash in node lists. so basically, same energy, different target. π₯
okay so this command is picky in the best way and it recognizes a whole lil menu of options. We're going through every single one, no skips, periodt π
-inβ hands you a list of every node that has at least one outgoing arc landing in a node from the set of nodes you specified. Another way to say it: it's the set of source nodes for the-inarcs of that node set. Basically the incoming neighbours β¨-outβ hands you a list of every node that has at least one incoming arc starting in a node from your specified set. Or, phrased differently: the set of target nodes for the-outarcs of the node set. the outgoing neighbours π-adjβ this one's the union of whatever-inand-outgive back. the neighbours, full stop π«Ά-innerβ the set of neighbours (same as-adjup there π) that are also in the set of nodes. Translation: the intersection between the set of nodes and the neighbours per-adjπΈ-embeddingβ the set of neighbours (yep,-adjagain) that are not in the set of nodes. I.e. the difference between the neighbours as per-adjand the set of nodes π¦-keykey β narrows the returned node list down to only those nodes that have an associated key key π-valuevalue β heads up, this one can only be used together with-key. It narrows the list further, to those nodes whose associated key key has the value value β¨-filtercmdrefix β limits the returned node list to nodes that pass the test. The command in cmdprefix gets called with two arguments: the name of the graph object, and the name of the node in question. It runs in the context of the caller and has to return a boolean value. Any node the command returns false for gets yeeted out of the result list before it ever reaches you ποΈ
graphName get key
Returns the value associated with the key key for the graph. Simple as that π
graphName getall ?pattern?
Returns a dictionary for the whole graph (one that's suitable for use with [array set], iykyk). If pattern is given, only the attributes whose names match the pattern show up in the returned dictionary. And pattern is a glob pattern π
graphName keys ?pattern?
Returns a list of keys for the whole graph. If pattern is specified, only attributes whose names match the pattern make it into the returned list. Again: glob pattern β¨
graphName keyexists key
Returns true if the specified key exists for the whole graph. That's it, that's the whole method π
graphName serialize ?node...?
okay this one is iconic. This method serializes the sub-graph spanned up by the nodes. In other words, it returns a tcl value that completely describes that graph. If you don't specify any nodes, the whole graph gets serialized. Which means you can, for example, transfer graph objects (or parts of them) over arbitrary channels, do persistence, all of that π¦ This method is also literally the basis for both the copy constructor and the assignment operator, so like, main character energy fr fr.
The result of this method has to be semantically identical across all implementations of the graph interface. That's the whole point β it's what lets us copy graph data between different implementations of the same interface π
The result is a list containing a multiple of three items, plus one! So: '[llength $serial] % 3 == 1'. Valid values include 1, 4, 7, ...
The last element of the list is a dictionary holding the attributes associated with the whole graph. As for all the other elements β each triple consists of:
- The name of the node to be described,
- A dictionary containing the attributes associated with the node,
- And a list describing all the arcs starting at that node.
The elements of the arc list are lists containing three or four elements each, like so:
- The name of the arc described by the element,
- A reference to the destination node of the arc. This reference is an integer number giving the index of that node in the main serialization list. Because of that it's greater than or equal to zero, less than the length of the serialization, and a multiple of three.
Note: for internal consistency, no arc name may be used twice β whether within the same node, or at some other node. This is a global consistency requirement for the serialization, no cap.
- And a dictionary containing the attributes associated with the arc.
- The weight associated with the arc. This value is optional. Its non-presence means that the arc in question has no weight associated with it.
Note: this information is new, compared to the serialization of graph 2.3 and earlier. By making it an optional element, the new format is maximally compatible with the old one. Which means any graph that doesn't use weights will generate a serialization that's still understood by the older graph package. A serialization will not be understood any longer by the older packages if, and only if, the graph it was generated from actually has arcs with weights. That's the whole deal π
For all attribute dictionaries, the keys are the names of the attributes, and the values are the values for each name β¨
Note: the order of the nodes in the serialization has no relevance, and neither does the order of the arcs per node. Don't read into it bestie π
# A possible serialization for the graph structure
#
# d -----> %2
# / ^ \
# / / \
# / b \
# / / \
# %1 <- a - %0 e
# ^ \\ /
# \\ c /
# \\ \\ /
# \\ v v
# f ------ %3
# is
#
# %3 {} {{f 6 {}}} %0 {} {{a 6 {}} {b 9 {}} {c 0 {}}} %1 {} {{d 9 {}}} %2 {} {{e 0 {}}} {}
#
# This assumes that the graph has neither attribute data nor weighted arcs.
graphName set key ?value?
Set or get one of the keyed values associated with a graph. A graph can have any number of keyed values hanging off it, she's flexible π If value isn't specified, this command returns the current value assigned to the key; if value is specified, this command assigns that value to the key. Two-for-one behaviour, we love to see it π«Ά
graphName swap node1 node2
Swaps the position of node1 and node2 in the graph. Just a lil switcheroo π
graphName unset key
Removes a keyed value from the graph. And if the key doesn't exist? The method will do nothing β no error, no drama, just vibes β¨
graphName walk node ?-order order? ?-type type? ?-dir direction? -command cmd
Performs a breadth-first or depth-first walk of the graph, starting at the node node, going either in the direction of the outgoing arcs or opposite to the incoming arcs. Choose your adventure πΆββοΈ
The type of walk β breadth-first or depth-first β is determined by the value of type; bfs means breadth-first, dfs means depth-first. Depth-first is the default π
The order of the walk β pre-order, post-order or both-order β is determined by the value of order; pre means pre-order, post means post-order, both means both-order. Pre-order is the default. Pre-order walking means a node gets visited before any of its neighbors (as defined by the direction, see below π). Post-order walking means a parent gets visited after any of its neighbors. Both-order walking means a node gets visited before and after any of its neighbors.
illegal combo alert π¨: combining a breadth-first walk with post-order or both-order is illegal. Don't do it.
The direction of the walk is determined by the value of dir; backward means the direction opposite to the incoming arcs, forward means the direction of the outgoing arcs.
As the walk progresses, the command cmd will be evaluated at each node, with the mode of the call (enter or leave) and the values graphName and the name of the current node appended. For a pre-order walk, all nodes are entered; for a post-order, all nodes are left. In a both-order walk, the first visit of a node enters it, and the second visit leaves it πΈ
β¨ CHANGES FOR 2.0 β¨
The following noteworthy changes have occurred, and bestie, some of them are a big deal:
- The API for accessing attributes and their values has been simplified. All functionality regarding the default attribute
"data"has been removed. This default attribute does not exist anymore. Every single access to attributes now has to specify the name of the attribute in question. This backward incompatible change is what allowed us to simplify the signature of all methods handling attributes. Especially, the flag-keyis not required anymore β and even more, its use is now forbidden π³ Please read the documentation for the arc and node methodsset,get,getall,unset,append,lappend,keyexistsandkeysfor a description of the new API's. - The methods
keysandgetallnow take an optional pattern argument and will return only attribute data for keys matching this pattern π - Arcs and nodes can now be renamed. See the documentation for the methods
arc renameandnode rename⨠- The structure has been extended with API's for the serialization and deserialization of graph objects, plus a number of operations based on them (graph assignment, copy construction). Please read the documentation for the methods
serialize,deserialize,=, and-->, and the documentation on the construction of graph objects. Beyond the copying of whole graph objects, these new API's also enable the transfer of graph objects over arbitrary channels and make persistence easy π¦ - A new method,
attr, was added to both arc and node, allowing the query and retrieval of attribute data without regard to arc and node relationships π - Both methods
arcsandnodeshave been extended with the ability to select arcs and nodes based on an arbitrary filtering criterium π₯
π BUGS, IDEAS, FEEDBACK π
okay bestie, real talk: this doc? and the whole package it's describing? they will undoubtedly have bugs and other problems. not being shady, that's just how software works, it's giving human. so if you find something cursed, please go report it in the category struct :: graph of the Tcllib Trackers at http://core.tcl.tk/tcllib/reportlist. π«Ά
and not just bugs! if you have ideas for enhancements for either the package and/or the documentation, like, please also report those. we wanna hear it, no cap. β¨
π when you're proposing code changes, please provide unified diffs, i.e. the output of diff -u. this is the way.
also lowkey important: attachments are strongly preferred over inlined patches. how do you attach stuff? easy β go to the Edit form of the ticket right after you create it, then hit the left-most button in the secondary navigation bar. iconic behavior, slay. π
β¨ KEYWORDS β¨
adjacent, arc, cgraph, degree, edge, graph, loop, neighbour, node, serialization, subgraph, vertex
(iykyk β these are the search terms that'll find this page when your brain has forgotten every word except "graph thingy") π¦
π CATEGORY π
Data structures
π COPYRIGHT π
Copyright (c) 2002-2009,2019 Andreas Kupries <andreas_kupries@users.sourceforge.net>
and that's the whole page bestie, we made it to the end ππ
this gorgeous thing lives in tcllib, version 2.4.4, and it's the struct::graph(3tcl) manual page. go forth and build graphs, and remember: every node deserves a neighbour. πΈπ§β
no cap, fr fr, this was a group project and you carried it. π
π¦ where this page comes from
- debian trixie: tcllib 2.0+dfsg-4 Β· Tcl
- ubuntu questing: tcllib 2.0+dfsg-4
- ubuntu resolute: tcllib 2.0+dfsg-5 Β· Tcl
- ubuntu stonking: tcllib 2.0+dfsg-6 Β· Tcl
- Copyright (c) 2002-2009,2019 Andreas Kupries <andreas_kupries@users\&.sourceforge\&.net>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms