![]() |
Synthia
Generic and flexible data structure generator
|
Generates a graph following the Barabási–Albert model.
Such a graph is generated by first picking a number of vertices. For each new vertex n' added to the graph, an edge is added to an existing node n with probability dn/D, where dn is the current degree of n and D is the sum of the degrees of all pre-existing vertices.
The resulting graph has the property of being scale-free: it contains few vertices with high degree, and many vertices with low degree. An example of a graph generated by this program is the following:
In the source code, this graph is merely printed to the console in the DOT format of the Graphviz graph rendering tool.
Definition at line 54 of file BarabasiAlbert.java.

Public Member Functions | |
| BarabasiAlbert (Picker< Node< T >> node_picker, Picker< Integer > size, Reactive< Float, Boolean > coin) | |
| Node< T > | pick () |
| Picks an object. More... | |
| Picker< Node< T > > | duplicate (boolean with_state) |
| Creates a copy of the picker. More... | |
Public Member Functions inherited from ca.uqac.lif.synthia.tree.GraphPicker< T > | |
| GraphPicker (Picker< Node< T >> node_picker, Picker< Integer > size) | |
| Set< Node< T > > | getNodes () |
| Gets the set of nodes in the last graph generated. More... | |
| int | getMaxDegree () |
| Gets the maximum out degree in a set of nodes in the last graph generated. More... | |
| void | reset () |
| Puts the picker back into its initial state. More... | |
Static Public Member Functions | |
| static void | main (String[] args) |
Protected Attributes | |
| Reactive< Float, Boolean > | m_coin |
Protected Attributes inherited from ca.uqac.lif.synthia.tree.GraphPicker< T > | |
| Picker< Node< T > > | m_nodePicker |
| Picker< Integer > | m_size |
| Set< Node< T > > | m_nodes |
Additional Inherited Members | |
Protected Member Functions inherited from ca.uqac.lif.synthia.tree.GraphPicker< T > | |
| void | connect (Node< T > n1, Node< T > n2) |
| Connects two nodes in a graph. More... | |
| examples.graphs.BarabasiAlbert< T >.BarabasiAlbert | ( | Picker< Node< T >> | node_picker, |
| Picker< Integer > | size, | ||
| Reactive< Float, Boolean > | coin | ||
| ) |
Definition at line 73 of file BarabasiAlbert.java.
| Picker<Node<T> > examples.graphs.BarabasiAlbert< T >.duplicate | ( | boolean | with_state | ) |
Creates a copy of the picker.
| with_state | If set to false, the returned copy is set to the class' initial state (i.e. same thing as calling the picker's constructor). If set to true, the returned copy is put into the same internal state as the object it is copied from. |
Implements ca.uqac.lif.synthia.Picker< T >.
Definition at line 112 of file BarabasiAlbert.java.
|
static |
Definition at line 56 of file BarabasiAlbert.java.
| Node<T> examples.graphs.BarabasiAlbert< T >.pick | ( | ) |
Picks an object.
Typically, this method is expected to return non-null objects; a null return value is used to signal that no more objects will be produced. That is, once this method returns null, it should normally return null on all subsequent calls.
Implements ca.uqac.lif.synthia.Picker< T >.
Definition at line 80 of file BarabasiAlbert.java.
|
protected |
Definition at line 71 of file BarabasiAlbert.java.