almayor / lem-in

A student project dealing with graph algorithms and data representation in C.

Home Page:https://almayor.github.io/lem-in

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

lem-in

This project is part of the official curriculum at School 42.

Disclaimer

At School 42, almost every project must be written to comply with a coding standard (also known as the "Norm"). As a result, the implementation of certain parts may appear strange.

Overview

  • Official instructions
  • Code documentation
  • Algorithm explanation
  • This project practices the following algorithmic topics
    • minimum cost maximum flow (Ford-Fulkerson, Suurballe)
    • path search in directed graphs (BFS, Dijkstra, Bellman-Ford)
    • sorts (quick sort, insertion sort)
    • efficient data representation (priority queues, graphs, arrays, queues, linked lists)

Run

To compile, run

git clone https://github.com/almayor/lem-in
cd lem-in
git submodule --init --recursive
make

Then try some example maps

./lem-in < example-maps/flow-thousand.txt

or generate your own

./generator-osx --flow-thousand | ./lem-in

(NOTE you could use generator-linux to run the generator on Linux.)

Test

Your can check that a generated solution is correct using the provided Python script check-solution

./lem-in < {your-map} | ./check-solution

Alternatively, you can run the whole batch of included tests with

make test

Algorithm

I have written a detailed PDF to outline my thought process when designing the algorithm. Please have a look if you're interested.

Useful links

  1. https://courses.csail.mit.edu/6.854/06/scribe/s12-minCostFlowAlg.pdf
  2. http://www.macfreek.nl/memory/Disjoint_Path_Finding
  3. https://en.wikipedia.org/wiki/Suurballe%27s_algorithm

Acknowledgements

We are grateful to the entire team behind School 42 and its Moscow branch, as well as to my fellow students for help and support. Some ideas for tests found in example-maps are borrowed from a similar project by davhojt.


If you have any questions, please contact me on Github.

About

A student project dealing with graph algorithms and data representation in C.

https://almayor.github.io/lem-in

License:MIT License


Languages

Language:C 90.4%Language:Python 4.0%Language:Makefile 3.4%Language:Shell 2.2%