Skip to content

Commit 04ef972

Browse files
committed
add: football network - WIP
1 parent b275ab0 commit 04ef972

File tree

4 files changed

+417
-61
lines changed

4 files changed

+417
-61
lines changed

doc/source/community_detection_guide/networks/README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,32 @@ A network of friendships among male students in a small high school in Illinois
4949
### License
5050
These data can be cited as:
5151

52-
> J. S. Coleman, Introduction to Mathematical Sociology, London Free Press Glencoe (1964).
52+
> J. S. Coleman, Introduction to Mathematical Sociology, London Free Press Glencoe (1964).
5353
5454
---
5555

5656
### Source
5757

5858
This file was obtained from:
5959
https://networks.skewed.de/net/highschool#None_draw
60+
61+
---
62+
---
63+
---
64+
65+
### README for `football/football.gml`
66+
67+
A network representation of a sporting competition. The vertices in the network represent the teams in one of the regional competitions or ‘‘conferences’’ of U.S. universities in the game of American football. Edges join pairs of teams that played one another during the 2005 football season.
68+
---
69+
70+
### License
71+
These data can be cited as:
72+
73+
> E. A. Leicht, M. E. J. Newman, Community Structure in Directed Networks, Physical Review Letters (2008).
74+
75+
---
76+
77+
### Source
78+
79+
This file was built with `build_football_network.py` obtained from this paper:
80+
https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.100.118703
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
import igraph as ig
2+
import os
3+
4+
5+
nodes = [
6+
"Pennsylvania State", "Northwestern", "Ohio State", "Minnesota",
7+
"Michigan", "Iowa", "Wisconsin", "Illinois", "Michigan State",
8+
"Purdue", "Indiana"
9+
]
10+
11+
edges = [
12+
("Pennsylvania State", "Northwestern"),
13+
("Pennsylvania State", "Minnesota"),
14+
("Pennsylvania State", "Illinois"),
15+
("Pennsylvania State", "Purdue"),
16+
("Pennsylvania State", "Michigan State"),
17+
("Pennsylvania State", "Wisconsin"),
18+
("Pennsylvania State", "Ohio State"),
19+
20+
("Northwestern", "Illinois"),
21+
("Northwestern", "Purdue"),
22+
("Northwestern", "Iowa"),
23+
("Northwestern", "Michigan State"),
24+
("Northwestern", "Wisconsin"),
25+
26+
("Minnesota", "Purdue"),
27+
("Minnesota", "Indiana"),
28+
("Minnesota", "Michigan"),
29+
("Minnesota", "Michigan State"),
30+
31+
("Iowa", "Minnesota"),
32+
("Iowa", "Illinois"),
33+
("Iowa", "Purdue"),
34+
("Iowa", "Indiana"),
35+
("Iowa", "Wisconsin"),
36+
37+
("Ohio State", "Iowa"),
38+
("Ohio State", "Illinois"),
39+
("Ohio State", "Michigan"),
40+
("Ohio State", "Michigan State"),
41+
("Ohio State", "Indiana"),
42+
("Ohio State", "Northwestern"),
43+
("Ohio State", "Minnesota"),
44+
45+
("Michigan", "Iowa"),
46+
("Michigan", "Michigan State"),
47+
("Michigan", "Indiana"),
48+
("Michigan", "Pennsylvania State"),
49+
("Michigan", "Northwestern"),
50+
51+
("Wisconsin", "Indiana"),
52+
("Wisconsin", "Illinois"),
53+
("Wisconsin", "Purdue"),
54+
("Wisconsin", "Michigan"),
55+
("Wisconsin", "Minnesota"),
56+
57+
("Purdue", "Illinois"),
58+
("Purdue", "Indiana"),
59+
("Purdue", "Michigan State"),
60+
61+
("Michigan State", "Indiana"),
62+
("Michigan State", "Illinois"),
63+
64+
("Indiana", "Illinois")
65+
]
66+
67+
g = ig.Graph.TupleList(edges, directed=True)
68+
69+
# Assign node names and community attributes
70+
g.vs["name"] = nodes
71+
72+
73+
local_path = "football/football.gml"
74+
script_dir = os.path.dirname(os.path.abspath(__file__))
75+
full_local_path = os.path.join(script_dir, local_path)
76+
g.write_gml(full_local_path)
Lines changed: 281 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,281 @@
1+
Creator "igraph version 0.10.16-926-gbe53d68e0 Fri Aug 29 11:37:51 2025"
2+
Version 1
3+
graph
4+
[
5+
directed 1
6+
node
7+
[
8+
id 0
9+
name "Pennsylvania State"
10+
]
11+
node
12+
[
13+
id 1
14+
name "Northwestern"
15+
]
16+
node
17+
[
18+
id 2
19+
name "Ohio State"
20+
]
21+
node
22+
[
23+
id 3
24+
name "Minnesota"
25+
]
26+
node
27+
[
28+
id 4
29+
name "Michigan"
30+
]
31+
node
32+
[
33+
id 5
34+
name "Iowa"
35+
]
36+
node
37+
[
38+
id 6
39+
name "Wisconsin"
40+
]
41+
node
42+
[
43+
id 7
44+
name "Illinois"
45+
]
46+
node
47+
[
48+
id 8
49+
name "Michigan State"
50+
]
51+
node
52+
[
53+
id 9
54+
name "Purdue"
55+
]
56+
node
57+
[
58+
id 10
59+
name "Indiana"
60+
]
61+
edge
62+
[
63+
source 0
64+
target 1
65+
]
66+
edge
67+
[
68+
source 0
69+
target 2
70+
]
71+
edge
72+
[
73+
source 0
74+
target 3
75+
]
76+
edge
77+
[
78+
source 0
79+
target 4
80+
]
81+
edge
82+
[
83+
source 0
84+
target 5
85+
]
86+
edge
87+
[
88+
source 0
89+
target 6
90+
]
91+
edge
92+
[
93+
source 0
94+
target 7
95+
]
96+
edge
97+
[
98+
source 1
99+
target 3
100+
]
101+
edge
102+
[
103+
source 1
104+
target 4
105+
]
106+
edge
107+
[
108+
source 1
109+
target 8
110+
]
111+
edge
112+
[
113+
source 1
114+
target 5
115+
]
116+
edge
117+
[
118+
source 1
119+
target 6
120+
]
121+
edge
122+
[
123+
source 2
124+
target 4
125+
]
126+
edge
127+
[
128+
source 2
129+
target 9
130+
]
131+
edge
132+
[
133+
source 2
134+
target 10
135+
]
136+
edge
137+
[
138+
source 2
139+
target 5
140+
]
141+
edge
142+
[
143+
source 8
144+
target 2
145+
]
146+
edge
147+
[
148+
source 8
149+
target 3
150+
]
151+
edge
152+
[
153+
source 8
154+
target 4
155+
]
156+
edge
157+
[
158+
source 8
159+
target 9
160+
]
161+
edge
162+
[
163+
source 8
164+
target 6
165+
]
166+
edge
167+
[
168+
source 7
169+
target 8
170+
]
171+
edge
172+
[
173+
source 7
174+
target 3
175+
]
176+
edge
177+
[
178+
source 7
179+
target 10
180+
]
181+
edge
182+
[
183+
source 7
184+
target 5
185+
]
186+
edge
187+
[
188+
source 7
189+
target 9
190+
]
191+
edge
192+
[
193+
source 7
194+
target 1
195+
]
196+
edge
197+
[
198+
source 7
199+
target 2
200+
]
201+
edge
202+
[
203+
source 10
204+
target 8
205+
]
206+
edge
207+
[
208+
source 10
209+
target 5
210+
]
211+
edge
212+
[
213+
source 10
214+
target 9
215+
]
216+
edge
217+
[
218+
source 10
219+
target 0
220+
]
221+
edge
222+
[
223+
source 10
224+
target 1
225+
]
226+
edge
227+
[
228+
source 6
229+
target 9
230+
]
231+
edge
232+
[
233+
source 6
234+
target 3
235+
]
236+
edge
237+
[
238+
source 6
239+
target 4
240+
]
241+
edge
242+
[
243+
source 6
244+
target 10
245+
]
246+
edge
247+
[
248+
source 6
249+
target 2
250+
]
251+
edge
252+
[
253+
source 4
254+
target 3
255+
]
256+
edge
257+
[
258+
source 4
259+
target 9
260+
]
261+
edge
262+
[
263+
source 4
264+
target 5
265+
]
266+
edge
267+
[
268+
source 5
269+
target 9
270+
]
271+
edge
272+
[
273+
source 5
274+
target 3
275+
]
276+
edge
277+
[
278+
source 9
279+
target 3
280+
]
281+
]

doc/source/community_detection_guide/notebooks/working_with_directed_networks.ipynb

Lines changed: 38 additions & 60 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)