ALGO3 - Graph (Adjacency Matrix, C)

ALGO3 - Graph (Adjacency Matrix, C)

This repository is prepared for the ALGO3 teaching pattern based on:

algorithms graph c-programming

Summary

Adjacency matrix representasi graph berarah 4 simpul

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

Alur translasi: model graph menjadi matriks lalu operasi query

FileTopic
pertemuan1/graph_tak_berarah.cUndirected graph: degree and basic queries
pertemuan2/graph_berarah.cDirected graph: indegree/outdegree, two-step queries
pertemuan3/cetak_semua_path.cPrint all paths A → D without revisiting (brute force, per tugas3.png)
MakefileQuick 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