Module traitgraph::algo::predefined_graphs[][src]

Expand description

Algorithms to create certain parameterisable graph classes, like binary trees.

Functions

Computes the amount of edges in a graph with n nodes, given the hamiltonian edge factor c.

Adds a binary tree to the given graph. The first added node is the root of the tree. A negative depth adds no nodes to the graph, a depth of 0 just the root, a depth of 1 the root an its children, and so on.

Creates a random graph with the given amount of nodes. Assumes that the graph is empty. The amount of arcs will be c * n * (log(n) + log(log(n))), where n is the amount of nodes.

Creates a random hamiltonian graph with the given amount of nodes. Assumes that the graph is empty. The amount of arcs will be c * n * (log(n) + log(log(n))), where n is the amount of nodes.