How syzio/hungarian-go works
Hungarian is a small Go library for solving assignment problems. A caller configures a solver, supplies a cost matrix, and receives a Result with assignments and cost. The runtime validates the matrix, prepares it for minimization and square dimensions as needed, runs the Kuhn–Munkres algorithm, and filters dummy and forbidden assignments. Result exposes mapping, string, and JSON representations. The sampled source supports these runtime relationships; no external services or persistent state are involved.
Main entry points: hungarian.go Hungarian solver · result.go Result API · errors.go Error sentinels
Components 7
Other components
- Library caller
- Hungarian solver
hungarian.go - Matrix validation
hungarian.go - Matrix preparation
hungarian.go - Kuhn–Munkres
hungarian.go - Result API
result.go - Error sentinels
errors.go
Connections 8
- Library caller → Hungarian solver: configures and submits matrix
- Hungarian solver → Matrix validation: validates
- Matrix validation → Error sentinels: wraps invalid input
- Hungarian solver → Matrix preparation: normalizes and pads
- Hungarian solver → Kuhn–Munkres: runs
- Hungarian solver → Result API: returns result
- Hungarian solver → Error sentinels: wraps invalid mode
- Library caller → Result API: reads or marshals