You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This assignment was asking to detect the [k-cores](https://en.wikipedia.org/wiki/Degeneracy_(graph_theory)) of a graph. Implement the following algorithm to find the core number of each node of any given graph:
3
+
This assignment required to detect the [k-cores](https://en.wikipedia.org/wiki/Degeneracy_(graph_theory)) of a graph. Implement the following algorithm to find the core number of each node of any given graph:
4
4
5
-
The greek version of the assignment description is found [here](https://github.com/dmst-algorithms-course/assignment-2019-1/blob/master/assignment_2019_1.ipynb)
where `input_file` is the name of the file that contains the graph we wish to analyze. The graph files have the following form:
14
+
15
+
0 1
16
+
0 2
17
+
1 3
18
+
2 3
19
+
2 6
20
+
2 7
21
+
3 6
22
+
3 7
23
+
3 8
24
+
4 5
25
+
5 6
26
+
5 10
27
+
6 7
28
+
7 8
29
+
7 11
30
+
8 9
31
+
32
+
In other words, each line of the file describes one edge between two nodes. In fact, all graphs are undirected.
33
+
34
+
## Example
35
+
The script is runned for the text file [example_graph.txt](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-1/graphs/example_graph.txt):
36
+
37
+
`python k_cores.py example_graph.txt`
38
+
39
+
The exit of the script should be the following:
40
+
41
+
0 2
42
+
1 2
43
+
2 3
44
+
3 3
45
+
4 1
46
+
5 1
47
+
6 3
48
+
7 3
49
+
8 2
50
+
9 1
51
+
10 1
52
+
11 1
53
+
54
+
Also, run the script for the graph [human brain functional activations](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-1/graphs/human_brain_functional_activations.txt) and verify the [solutions](https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-1/solutions/human_brain_solutions.txt).
55
+
56
+
##
57
+
[Complete Greek version of the assignment description](https://github.com/dmst-algorithms-course/assignment-2019-1/blob/master/assignment_2019_1.ipynb)
0 commit comments