graphtools

classes and functions related to array handling

Source:

Classes

Graph
GraphStructs

Methods

(inner) graph_complete(nodesopt, directedopt) → {Graph}

Source:

returns graph complete graph

Examples
g = graph_complete( 9 );
g.number_of_nodes() --> 9
g.size() --> 36
 
g = graph_complete( _irange( 11, 14 ) );
g.number_of_nodes() --> 3
g.nodes().sorted() --> 11, 12, 13
Parameters:
Name Type Attributes Default Description
nodes Iterable <optional>
0

If integer supplied, nodes are taken from Range( n )

directed Bool <optional>
false
Returns:
Type
Graph

(inner) graph_cycle(nodesopt, directedopt) → {Graph}

Source:

returns cyclically connected graph

Parameters:
Name Type Attributes Default Description
nodes Iterable <optional>
0

If integer supplied, nodes are taken from Range( n )

directed Bool <optional>
false
Returns:
Type
Graph

(inner) graph_empty(nodesopt, directedopt) → {Graph}

Source:

returns graph with no edges

Examples
g = graph_empty( 10 );
g.number_of_nodes() --> 10
g.number_of_edges() --> 0
 
g = graph_empty( "abc" );
g.number_of_nodes() --> 3
g.nodes().sorted() --> "a", "b", "c"
Parameters:
Name Type Attributes Default Description
nodes Iterable <optional>
0

If integer supplied, nodes are taken from Range( n )

directed Bool <optional>
false
Returns:
Type
Graph

(inner) graph_path(nodesopt, directedopt) → {Graph}

Source:

returns linearly connected graph

Parameters:
Name Type Attributes Default Description
nodes Iterable <optional>
0

If integer supplied, nodes are taken from Range( n )

directed Bool <optional>
false
Returns:
Type
Graph

(inner) graph_star(nodesopt, directedopt) → {Graph}

Source:

returns graph where all nodes are connected to the center node

Parameters:
Name Type Attributes Default Description
nodes Iterable <optional>
0

If integer supplied, nodes are taken from Range( nodes + 1 )

directed Bool <optional>
false
Returns:
Type
Graph