Skip to content

Commit b78a301

Browse files
authored
Update README.md for assignment 1
1 parent c97f37a commit b78a301

File tree

1 file changed

+54
-2
lines changed

1 file changed

+54
-2
lines changed

assignment-1/README.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,58 @@
11
# Degeneracy - Graph Theory
22

3-
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:
44

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)
5+
6+
<img src="https://github.com/stef4k/Algorithms-and-data-structures-assignments/blob/main/assignment-1/images/kcores%20algorithm.png" width="500" height="600" />
7+
8+
## Running the script
9+
Use the command line to run the script:
10+
11+
`python k_cores.py <input_file>`
12+
13+
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)
658

0 commit comments

Comments
 (0)