ALGO3 - Graph (Adjacency Matrix, C)
This repository is prepared for the ALGO3 teaching pattern based on:
algorithms graph c-programming
Summary
This repository is prepared for the ALGO3 teaching pattern based on imperative graph representation in C. The approach used is deliberately simple so that the foundations of data structures and model translation are explicit.
Scope of material:
- Graph representation with
int M[n][n] - Translation of model → data → operations
- Direct queries, multi-step queries, and matrix traversal
- Path enumeration via brute force (without formal DFS/BFS)
Directory Structure
| File | Topic |
|---|---|
pertemuan1/graph_tak_berarah.c | Undirected graph: degree and basic queries |
pertemuan2/graph_berarah.c | Directed graph: indegree/outdegree, two-step queries |
pertemuan3/cetak_semua_path.c | Print all paths A → D without revisiting (brute force, per tugas3.png) |
Makefile | Quick build and run |
Usage
Build
make all
Run
make run-p1
make run-p2
make run-p3
Academic Notes
The focus of this repo is the foundation of graph data structures in an imperative and procedural way.
The material does not yet cover formal algorithms such as:
- Recursive DFS
- BFS
- Dijkstra
- Topological sort