Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
gs-algo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
graphstream
gs-algo
Commits
6ce144de
Commit
6ce144de
authored
Apr 17, 2012
by
gsavin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the way where a node is selected to be connected to the new one.
parent
69d5d279
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
src/org/graphstream/algorithm/generator/RandomGenerator.java
src/org/graphstream/algorithm/generator/RandomGenerator.java
+9
-5
No files found.
src/org/graphstream/algorithm/generator/RandomGenerator.java
View file @
6ce144de
...
...
@@ -75,18 +75,18 @@ import org.graphstream.algorithm.Toolkit;
* <h2>Complexity</h2>
*
* <p>
* At each call to {@link #nextEvents()} at max k operations are run with
*
k the
average degree.
* At each call to {@link #nextEvents()} at max k operations are run with
k the
* average degree.
* </p>
*
* <h2>Example</h2>
*
* <pre>
* Graph graph = new SingleGraph(
"Random"
);
* Graph graph = new SingleGraph(
"Random"
);
* Generator gen = new RandomGenerator();
* gen.addSinkg(graph);
* gen.begin();
* for
(int i=0; i<
100; i++)
* for
(int i = 0; i <
100; i++)
* gen.nextEvents();
* gen.end();
* graph.display();
...
...
@@ -195,7 +195,11 @@ public class RandomGenerator extends BaseGenerator {
// to the new node.
for
(
int
i
=
0
;
i
<
degree
;
++
i
)
{
String
otherId
=
Toolkit
.
randomNode
(
internalGraph
,
random
).
getId
();
String
otherId
;
do
otherId
=
Toolkit
.
randomNode
(
internalGraph
,
random
).
getId
();
while
(
otherId
==
id
&&
internalGraph
.
getNodeCount
()
>
1
);
if
(
otherId
!=
id
)
{
String
edgeId
=
getEdgeId
(
id
,
otherId
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment