College assignment for graph theory class
# for debian based linux system
$ sudo add-apt-repository ppa:deadsnakes/ppa
$ sudo apt-get update
$ sudo apt install python3.8
$ python3.8 -V
# last command should yield "Python 3.8.5"
# for Debian based Linux system
$ apt install python3-pip
The first is to install the required packages from the requirements.txt
file. This is the faster option, but due to system differences, some problems might arise. They shouldn't, but they might.
# in repository root
$ pip3 install -r requirements.txt
The second option is to install all the required packages manually. I list all the packages in this single command.
# in the repository root
$ pip3 install networkx matplotlib numpy
.
├── Dijkstra’s algorithm
│ ├── algorithm
│ │ ├── dijkstra.py # my algorithm implementation
│ │ └── __init__.py
│ ├── algorithm analysis.md # analitical part of the practical aspect of the assignment
│ ├── test_dataset.json # test graphs in incidence matrix form
│ ├── test_images
│ │ └── # tests output folder - graph drawings
│ └── test.py # main file - tests file
├── Jan_Karpiuk.json # assignment original file
├── Jan_Karpiuk_proj.docx # assignment instructions
├── LICENSE # license file
├── README.md # setup instructions,
└── requirements.txt # required python packages
$ python Dijkstra’s\ algorithm/test.py
Successful tests should yield:
..
------------------------------------------------------------
Ran 2 tests in 2.576s
OK
Tests take the test_dataset.json
file as a testing dataset.
In order to test more graphs, update the test_dataset.json
file with new graph data in form of an incidence matrix
Each file is named according to the test in with it was created with the test number added at the end.
-
test_dijkstra_path_0.png
- first graph image for test validating algorithm's dijkstra path calculation -
test_dijkstra_path_length_5.png
- sixth graph image for test validating algorithm's dijkstra path length calculation
Each file contains the image of a tested graph with Dijkstra's path marked in red for a particular test case.