A collection of algorithm implementations in Go and Python. This repository contains solutions to various algorithmic problems including search algorithms, optimization problems, and AI/ML challenges. You can find more details and theory for the course in this github - https://github.com/ElitsaY/AI_FMI_course
- Go (1.21+) - for Go solutions
- Python (3.8+) - for Python solutions
- Clone the repository:
git clone <repository-url>
cd algorithms-solutions- Install Python dependencies (handled automatically by the Makefile for temp venvs; for persistent venvs they are installed during
make venv <task>). Consolidated dependencies live in the rootrequirements.txt.
pip install -r requirements.txtmake # Show help menu
make help # Show detailed help
make ls # List all available tasksmake run <task-name> # Auto-detects language and runs
make run frog-leap-puzzle # Example: Go
make run iris # Example: Python
make run decision-tree # Example: Python (ID3)
make run neural-networks # Example: Python (MLP, interactive)make build <task-name>
make build n-queensmake test <task-name>
make test tspmake clean <task-name> # Clean specific task
make clean-venvs # Remove Python venvs
make clean-all # Remove ALL binaries and .judge artifacts- Temporary venv (auto):
make py <task>— creates, installs dependencies from rootrequirements.txt, runs, then cleans up. - Persistent venv:
make venv <task>thenmake run <task>— installs from rootrequirements.txt, reuses environment.
make new <task-name>
make new my-algorithmalgorithms-solutions/
├── Makefile
├── README.md
├── requirements.txt
├── venv-run.sh
├── python-with-venv.sh
│
├── frog-leap-puzzle/
│ └── go/
├── n-queens/
│ └── go/
├── n-puzzle/
│ └── go/
├── tsp/
│ └── go/
├── iris/
│ └── python/
├── tic-tac-toe/
│ └── python/
├── naive-bayes-classifier/
│ └── python/
├── decision-tree/
│ └── python/
└── algorithms/
├── beam-search/
├── dfs-and-bfs/
├── dijkstra/
├── genetic/
└── minmax/
Task READMEs include theory, pseudocode, complexity, and exam tips:
- Frog Leap Puzzle — BFS/DFS/A* state modeling
- N-Queens — Backtracking and CSP
- N-Puzzle — A* and admissible heuristics (Manhattan)
- TSP — Exact vs heuristic (Nearest Neighbor, 2-Opt)
- Iris — KNN, scaling, cross-validation
- Naive Bayes Classifier — MAP rule, smoothing, variants
- Tic-Tac-Toe — Minimax and alpha-beta pruning
- Decision Tree — ID3 (entropy, information gain), pruning (REP)
- Neural Networks — MLP activations (sigmoid/tanh), backpropagation, XOR learnability
- Missing Python module: ensure dependencies are installed via
make venv <task>orpip install -r requirements.txt. - Judge artifacts: use
make clean <task>ormake clean-all. - Go build issues: initialize/tidy modules inside
<task>/go/.
See individual task directories for specific licensing information.