How eyesun23/matching-problem works
Project type and purpose
• This is a small, single‑script command‑line Python tool whose sole responsibility is to read two CSV files of preferences (one for girls, one for guys), compute a weighted matching, and write out a results CSV. It is not a multi‑tier web app or microservice but a linear data‑processing pipeline.
File structure
• Top level:
• MatchingProblem.py – contains all code (CSV I/O, data models, matching algorithm, output).
• Sheet6.csv, Sheet7.csv – input data for girls’ and guys’ preference weights.
• results.csv – the algorithm’s output.
• README.md – describes the overall purpose.
• No subdirectories or separate modules, so the internal architecture lives inside one file.
README for additional insights
• The README clarifies that each person ranks three preferences, assigns weights, and the match is computed based on those weights.
• No mention of external services or databases—everything is file‑based.
a. Input Layer (CSV Sources)
– “Girls Preferences” (Sheet6.csv)
– “Guys Preferences” (Sheet7.csv)
b. Parser / Data Loader
– Reads CSVs, validates rows, normalizes weights into in‑memory data structures (e.g., Python dicts or objects)
c. Matching Engine
– Core algorithm: iterates over preferences, computes weighted scores, picks best mutual matches
d. Results Writer
– Serializes matched pairs into results.csv
e. (Optional) Logging/Configuration
Architectural pattern and design principles
• Streaming pipeline (Input → Transform → Compute → Output).
• Single responsibility per component: one for I/O, one for core logic.
• Keep business logic (matching algorithm) decoupled from file format concerns (CSV parsing/serialization).
Relevant technologies & libraries
• Python interpreter (e.g., CPython)
• Built‑in csv module or pandas (if used)
• Standard logging (optional)
• argparse or click (optional CLI)