topolib 0.3.0__py3-none-any.whl → 0.4.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of topolib might be problematic. Click here for more details.

topolib/__init__.py ADDED
@@ -0,0 +1,4 @@
1
+ try:
2
+ from ._version import __version__
3
+ except ImportError:
4
+ __version__ = "unknown"
@@ -2,7 +2,7 @@
2
2
  Metrics module for network topology analysis.
3
3
  """
4
4
 
5
- from typing import List, Any, Dict, Optional
5
+ from typing import List, Dict, Optional
6
6
 
7
7
 
8
8
  from topolib.topology import Topology
@@ -12,16 +12,16 @@ class Metrics:
12
12
  """
13
13
  Provides static methods for computing metrics on network topologies.
14
14
 
15
- Todos los métodos reciben una instancia de Topology.
15
+ All methods receive a Topology instance.
16
16
 
17
- Métodos
17
+ Methods
18
18
  -------
19
19
  node_degree(topology)
20
- Calcula el grado de cada nodo.
20
+ Calculates the degree of each node.
21
21
  link_length_stats(topology)
22
- Calcula estadísticas (min, max, avg) de las longitudes de los enlaces.
22
+ Calculates statistics (min, max, avg) of link lengths.
23
23
  connection_matrix(topology)
24
- Construye la matriz de adyacencia.
24
+ Builds the adjacency matrix.
25
25
  """
26
26
 
27
27
  @staticmethod
@@ -0,0 +1,285 @@
1
+ {
2
+ "name": "Abilene",
3
+ "nodes": [
4
+ {
5
+ "id": 0,
6
+ "name": "Seattle",
7
+ "weight": 0,
8
+ "longitude": -122.3328481,
9
+ "latitude": 47.6061389,
10
+ "pop": 780995,
11
+ "DC": 58,
12
+ "IXP": 5
13
+ },
14
+ {
15
+ "id": 1,
16
+ "name": "Sunnyvale",
17
+ "weight": 0,
18
+ "longitude": -122.0363496,
19
+ "latitude": 37.36883,
20
+ "pop": 155805,
21
+ "DC": 0,
22
+ "IXP": 0
23
+ },
24
+ {
25
+ "id": 2,
26
+ "name": "Los Angeles",
27
+ "weight": 0,
28
+ "longitude": -118.242643,
29
+ "latitude": 34.0549076,
30
+ "pop": 3820914,
31
+ "DC": 71,
32
+ "IXP": 9
33
+ },
34
+ {
35
+ "id": 3,
36
+ "name": "Denver",
37
+ "weight": 0,
38
+ "longitude": -104.990251,
39
+ "latitude": 39.7392358,
40
+ "pop": 729019,
41
+ "DC": 49,
42
+ "IXP": 6
43
+ },
44
+ {
45
+ "id": 4,
46
+ "name": "Kansas City",
47
+ "weight": 0,
48
+ "longitude": -94.5785667,
49
+ "latitude": 39.0997265,
50
+ "pop": 475378,
51
+ "DC": 25,
52
+ "IXP": 1
53
+ },
54
+ {
55
+ "id": 5,
56
+ "name": "Houston",
57
+ "weight": 0,
58
+ "longitude": -95.3701108,
59
+ "latitude": 29.7600771,
60
+ "pop": 2314157,
61
+ "DC": 55,
62
+ "IXP": 6
63
+ },
64
+ {
65
+ "id": 6,
66
+ "name": "Atlanta",
67
+ "weight": 0,
68
+ "longitude": -84.3885209,
69
+ "latitude": 33.7501275,
70
+ "pop": 510823,
71
+ "DC": 145,
72
+ "IXP": 7
73
+ },
74
+ {
75
+ "id": 7,
76
+ "name": "Indianapolis",
77
+ "weight": 0,
78
+ "longitude": -86.158018,
79
+ "latitude": 39.76909,
80
+ "pop": 887642,
81
+ "DC": 30,
82
+ "IXP": 2
83
+ },
84
+ {
85
+ "id": 8,
86
+ "name": "Chicago",
87
+ "weight": 0,
88
+ "longitude": -87.6323879,
89
+ "latitude": 41.88325,
90
+ "pop": 2664452,
91
+ "DC": 165,
92
+ "IXP": 10
93
+ },
94
+ {
95
+ "id": 9,
96
+ "name": "Washington D.C.",
97
+ "weight": 0,
98
+ "longitude": -77.0368707,
99
+ "latitude": 38.9071923,
100
+ "pop": 689545,
101
+ "DC": 7,
102
+ "IXP": 3
103
+ },
104
+ {
105
+ "id": 10,
106
+ "name": "New York",
107
+ "weight": 0,
108
+ "longitude": -74.0059728,
109
+ "latitude": 40.7127753,
110
+ "pop": 8804190,
111
+ "DC": 70,
112
+ "IXP": 11
113
+ }
114
+ ],
115
+ "links": [
116
+ {
117
+ "id": 0,
118
+ "src": 0,
119
+ "dst": 1,
120
+ "length": 1482.26
121
+ },
122
+ {
123
+ "id": 1,
124
+ "src": 2,
125
+ "dst": 1,
126
+ "length": 649.31
127
+ },
128
+ {
129
+ "id": 2,
130
+ "src": 5,
131
+ "dst": 2,
132
+ "length": 2870.2
133
+ },
134
+ {
135
+ "id": 3,
136
+ "src": 4,
137
+ "dst": 5,
138
+ "length": 1360.7
139
+ },
140
+ {
141
+ "id": 4,
142
+ "src": 3,
143
+ "dst": 0,
144
+ "length": 2123.16
145
+ },
146
+ {
147
+ "id": 5,
148
+ "src": 3,
149
+ "dst": 1,
150
+ "length": 1949.85
151
+ },
152
+ {
153
+ "id": 6,
154
+ "src": 4,
155
+ "dst": 3,
156
+ "length": 1153.26
157
+ },
158
+ {
159
+ "id": 7,
160
+ "src": 8,
161
+ "dst": 7,
162
+ "length": 345.36
163
+ },
164
+ {
165
+ "id": 8,
166
+ "src": 4,
167
+ "dst": 7,
168
+ "length": 933.65
169
+ },
170
+ {
171
+ "id": 9,
172
+ "src": 5,
173
+ "dst": 6,
174
+ "length": 1471.24
175
+ },
176
+ {
177
+ "id": 10,
178
+ "src": 6,
179
+ "dst": 7,
180
+ "length": 912.61
181
+ },
182
+ {
183
+ "id": 11,
184
+ "src": 10,
185
+ "dst": 8,
186
+ "length": 1489.76
187
+ },
188
+ {
189
+ "id": 12,
190
+ "src": 6,
191
+ "dst": 9,
192
+ "length": 1126.74
193
+ },
194
+ {
195
+ "id": 13,
196
+ "src": 9,
197
+ "dst": 10,
198
+ "length": 416.12
199
+ },
200
+ {
201
+ "id": 14,
202
+ "src": 1,
203
+ "dst": 0,
204
+ "length": 1482.26
205
+ },
206
+ {
207
+ "id": 15,
208
+ "src": 1,
209
+ "dst": 2,
210
+ "length": 649.31
211
+ },
212
+ {
213
+ "id": 16,
214
+ "src": 2,
215
+ "dst": 5,
216
+ "length": 2870.2
217
+ },
218
+ {
219
+ "id": 17,
220
+ "src": 5,
221
+ "dst": 4,
222
+ "length": 1360.7
223
+ },
224
+ {
225
+ "id": 18,
226
+ "src": 0,
227
+ "dst": 3,
228
+ "length": 2123.16
229
+ },
230
+ {
231
+ "id": 19,
232
+ "src": 1,
233
+ "dst": 3,
234
+ "length": 1949.85
235
+ },
236
+ {
237
+ "id": 20,
238
+ "src": 3,
239
+ "dst": 4,
240
+ "length": 1153.26
241
+ },
242
+ {
243
+ "id": 21,
244
+ "src": 7,
245
+ "dst": 8,
246
+ "length": 345.36
247
+ },
248
+ {
249
+ "id": 22,
250
+ "src": 7,
251
+ "dst": 4,
252
+ "length": 933.65
253
+ },
254
+ {
255
+ "id": 23,
256
+ "src": 6,
257
+ "dst": 5,
258
+ "length": 1471.24
259
+ },
260
+ {
261
+ "id": 24,
262
+ "src": 7,
263
+ "dst": 6,
264
+ "length": 912.61
265
+ },
266
+ {
267
+ "id": 25,
268
+ "src": 8,
269
+ "dst": 10,
270
+ "length": 1489.76
271
+ },
272
+ {
273
+ "id": 26,
274
+ "src": 9,
275
+ "dst": 6,
276
+ "length": 1126.74
277
+ },
278
+ {
279
+ "id": 27,
280
+ "src": 10,
281
+ "dst": 9,
282
+ "length": 416.12
283
+ }
284
+ ]
285
+ }