Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
algorand
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nilak
algorand
Commits
43ea9df3
Commit
43ea9df3
authored
May 01, 2019
by
UNHALE NILESH ARUN
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
network generator
parent
7f498fec
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2246 additions
and
0 deletions
+2246
-0
Links1.dat
Links1.dat
+1965
-0
Nodes1.dat
Nodes1.dat
+200
-0
filegen.py
filegen.py
+81
-0
No files found.
Links1.dat
0 → 100644
View file @
43ea9df3
This diff is collapsed.
Click to expand it.
Nodes1.dat
0 → 100644
View file @
43ea9df3
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
filegen.py
0 → 100644
View file @
43ea9df3
import
hashlib
from
numpy.random
import
randint
import
sys
import
networkx
as
nx
import
matplotlib.pyplot
as
plt
from
networkx.algorithms
import
community
f
=
open
(
"Nodes1.dat"
,
"w"
)
for
i
in
range
(
int
(
sys
.
argv
[
1
])):
f
.
write
(
str
(
i
)
+
"
\n
"
)
# print(i)
f
.
close
()
# G = nx.Graph()
# G=nx.complete_graph(100)
# G1=nx.path_graph(100)
G2
=
nx
.
erdos_renyi_graph
(
int
(
sys
.
argv
[
1
]),
0.1
)
# G3=nx.fast_gnp_random_graph(100,0.1)
# G4=nx.connected_caveman_graph(100,0)
# print(nx.is_connected(G2))
# print(G2.edges())
if
nx
.
is_connected
(
G2
):
f
=
open
(
"Links1.dat"
,
"w"
)
count
=
0
for
edge
in
G2
.
edges
():
# print(edge)
# print(str(edge[0])+'\t'+str(edge[1])+'\n')
f
.
write
(
str
(
edge
[
0
])
+
'
\t
'
+
str
(
edge
[
1
])
+
'
\n
'
)
count
+=
1
f
.
close
()
print
(
'Nodes: '
,
sys
.
argv
[
1
],
'Edges: '
,
count
)
# nx.draw(G)
#
# from igraph import Graph
# # g = Graph.Erdos_Renyi(n=10000, m=100000)
# input_to_SHA256 = "asd"
#
# sha256_hash = hashlib.sha256()
# hs = hashlib.sha256(input_to_SHA256.encode('utf-8')).hexdigest()
#
# # print(pow(2,256))
#
# print(randint(1, 51, 1))
# print(randint(1, 51, 1))
# print(randint(1, 51, 1))
# print(randint(1, 51, 1))
# print(randint(1, 51, 1))
# print(randint(1, 51, 1))
# print(randint(1, 51, 1))
# print(randint(1, 51, 1))
# print(randint(1, 51, 1))
#
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