Class PreferentialAttachmentGenerator
java.lang.Object
org.graphstream.stream.SourceBase
org.graphstream.algorithm.generator.BaseGenerator
org.graphstream.algorithm.generator.PreferentialAttachmentGenerator
- All Implemented Interfaces:
Generator
,org.graphstream.stream.Source
@Deprecated public class PreferentialAttachmentGenerator extends BaseGenerator
Deprecated.
Scale-free tree generator using the preferential attachment rule as
defined in the Barabási-Albert model.
THIS GENERATOR IS DEPRECATED, USE THE BarabasiAlbertGenerator
INSTEAD.
This is a very simple graph generator that generates a tree using the preferential attachment rule defined in the Barabási-Albert model: nodes are generated one by one, and each time attached by an edge to another node that has more chance to chosen if it already has lots of nodes attached to it.
The more this generator is iterated, the more nodes are generated. It can therefore generate trees of any size.
- Since:
- 20061128
- Scientific Reference :
- Albert-László Barabási & Réka Albert "Emergence of scaling in random networks". Science 286: 509–512. October 1999. doi:10.1126/science.286.5439.509.
-
Nested Class Summary
-
Constructor Summary
Constructors Constructor Description PreferentialAttachmentGenerator()
Deprecated.New generator. -
Method Summary
Modifier and Type Method Description void
begin()
Deprecated.Start the generator.void
end()
Deprecated.Clean degrees.boolean
nextEvents()
Deprecated.Step of the generator.Methods inherited from class org.graphstream.algorithm.generator.BaseGenerator
addEdgeAttribute, addEdgeAttribute, addEdgeAttribute, addEdgeLabels, addNodeAttribute, addNodeAttribute, addNodeAttribute, addNodeLabels, isUsingInternalGraph, removeEdgeAttribute, removeNodeAttribute, setDirectedEdges, setRandomSeed, setUseInternalGraph
Methods inherited from class org.graphstream.stream.SourceBase
addAttributeSink, addElementSink, addSink, attributeSinks, clearAttributeSinks, clearElementSinks, clearSinks, elementSinks, removeAttributeSink, removeElementSink, removeSink, sendAttributeChangedEvent, sendAttributeChangedEvent, sendEdgeAdded, sendEdgeAdded, sendEdgeAttributeAdded, sendEdgeAttributeAdded, sendEdgeAttributeChanged, sendEdgeAttributeChanged, sendEdgeAttributeRemoved, sendEdgeAttributeRemoved, sendEdgeRemoved, sendEdgeRemoved, sendGraphAttributeAdded, sendGraphAttributeAdded, sendGraphAttributeChanged, sendGraphAttributeChanged, sendGraphAttributeRemoved, sendGraphAttributeRemoved, sendGraphCleared, sendGraphCleared, sendNodeAdded, sendNodeAdded, sendNodeAttributeAdded, sendNodeAttributeAdded, sendNodeAttributeChanged, sendNodeAttributeChanged, sendNodeAttributeRemoved, sendNodeAttributeRemoved, sendNodeRemoved, sendNodeRemoved, sendStepBegins, sendStepBegins
-
Constructor Details
-
PreferentialAttachmentGenerator
public PreferentialAttachmentGenerator()Deprecated.New generator.
-
-
Method Details
-
begin
public void begin()Deprecated.Start the generator. A single node is added.- See Also:
Generator.begin()
-
nextEvents
public boolean nextEvents()Deprecated.Step of the generator. Add a node and try to connect it with some others. The complexity of this method is O(n) with n the number of nodes actually in the graph.- Returns:
- true while there are elements to add to the graph.
- See Also:
Generator.nextEvents()
-
end
public void end()Deprecated.Clean degrees.- Specified by:
end
in interfaceGenerator
- Overrides:
end
in classBaseGenerator
- See Also:
Generator.end()
-