Car DNA — Genetic Algorithms for Smarter Car Choices An evolution-inspired vehicle recommendation project that connects everyday needs, trustworthy vehicle data, and sustainable transportation. Project status: The current user-facing website (DriveWise V2.1) uses a deterministic, explainable recommendation engine. A separate, earlier Car DNA genetic-algorithm prototype remains in the repository as historical and experimental work; it is not connected to the current website's main recommendation flow. The V3 data-expansion pipeline is also separate from the active website database. We make these distinctions so the demonstration accurately reflects what is implemented.
Why we built it Our idea started with a futuristic Tesla jet-powered car video on TikTok. We began asking what really drives the evolution of cars—not only technology, but also market demand, infrastructure, environmental conditions, and people's changing lifestyles. We first considered city-level questions such as the balance of electric and gasoline vehicles and where charging stations should be located. Then we shifted our focus to a more immediate question: How can someone find a car that actually fits their life? Car DNA explores that question through vehicle data, personalized recommendations, and an experimental approach inspired by biological evolution. We also care about energy efficiency and emissions, rather than treating the lowest purchase price as the only priority. What the current website does (DriveWise V2.1)
- A four-step questionnaire to capture vehicle needs and rank a user's top three priorities.
- Top-three recommendations and additional results, with ways to browse by body style, price, performance, and annual energy costs.
- Side-by-side comparison of up to three vehicles.
- Vehicle imagery where available, with clearly separated sources and supporting information.
- An explainable rule-based ranking that distinguishes verified matches from alternatives and missing information.
- Budget, powertrain, vehicle dimensions, passenger needs, driving patterns, and charging considerations, subject to what the data can substantiate. Important: Current website recommendations are generated by deterministic rules—not by the experimental genetic algorithm. Unknown vehicle specifications are not invented to produce a match. Project at a glance Component Current state Notes User-facing website V2.1 Four-step questionnaire, ranking, results, vehicle comparison Active website vehicle dataset 3,654 EPA configurations Manufacturer enrichment covers 40 configurations; 30 have complete core price/seating/power/cargo fields Independent V3 dataset 3,710 EPA configurations Includes 56 additional diesel configurations; does not automatically replace the active API database V3 normalized coverage 897 model-years, 356 cross-year model families Normalized by EPA baseModel V3 recommendation-ready configurations 40 Only 12 model-years have verified retail trims V3 licensed same-model-year imagery 6 model-years Full target of 300 verified trims/photos is not yet met Genetic algorithm Historical Phase 2 prototype Separate from today's main website recommendation route
For detailed datasets and limitations, see V3 documentation, data coverage report, and the V2.1 report. How the current recommendation engine works
- Collect preferences The questionnaire asks for practical constraints and preferences, then lets users identify their three most important priorities. The current system uses these answers to guide hard eligibility checks and weighted scoring.
- Check what the data actually confirms The engine validates vehicles against the user's stated requirements. By default, budget is strict, explicitly entered advanced hard constraints and seating requirements remain strict, and powertrain selection is strict; body style is generally treated as a softer preference. When the available data cannot prove that a vehicle meets a requirement, the website does not silently present it as verified.
- Score known attributes The V2 scoring dimensions are:
- Purchase price
- Estimated annual energy costs
- Performance
- Practicality
- Range and refueling/charging convenience
- Safety (when backed by evidence)
- Tailpipe emissions Each dimension starts at weight 1; the three highest priorities receive additional weight before normalization. Unknown scores remain null. The system reweights known dimensions and considers evidence coverage instead of treating missing values as real zeroes. A score is not a probability that a car is the perfect match.
- Explain and compare recommendations Results preserve source information, indicate gaps in the data, avoid unnecessary duplicate model families, and provide comparisons. If the dataset cannot support three qualifying cars, the engine does not fabricate a third match. Environmental scope: The available emissions signal is the EPA tailpipe metric. It does not represent manufacturing, electricity-generation, or complete lifecycle emissions. Data: source quality matters The project uses U.S. EPA vehicle data for vehicle configurations, fuel economy, electricity consumption, range, and tailpipe CO₂ information. Selected manufacturer specifications and pricing are backed by documentation from Toyota, Nissan, and Ford. A field-level evidence model tracks where enriched values come from. We do not assume that one vehicle's base MSRP applies to every trim. Historical MSRP is not a live dealer quote or a promise of inventory. Unknown fields remain unknown; missing safety data is not replaced with made-up safety ratings. V3: independent data expansion A separate data pipeline adds 56 diesel configurations to reach 3,710 EPA configurations. They represent 897 normalized model-years and 356 vehicle families across years. However, complete retail-trim verification and imagery are still limited: 12 verified trim model-years, 40 recommendation-ready configurations, and 6 model-years with verified, licensed same-year imagery. The goal of 300 fully verified trims and licensed photos has not yet been achieved. Build V3's independent JSON and CSV outputs with: node scripts/vehicle-data-v3.js build This does not replace the current website's API data. See V3 dataset documentation and the coverage report for the exact requirements, audit process, and metrics. Data enrichment and provenance The V2.1 pipeline includes:
- src/enrichment.js: missing-field audits and strict replay of verified evidence.
- src/image-resolver.js: vehicle images and link resolution.
- src/sensitivity.js: counterfactual analysis across ten scenarios.
- scripts/enrich.js: generate a missing-data queue or import a manually reviewed evidence batch.
node scripts/enrich.js
node scripts/enrich.js reviewed-batch.json Evidence records must match the actual vehicle identity and must use authorized, reviewable sources. The project does not scrape inaccessible sources automatically or guess specifications from model names. The earlier scripts/create-curated-supplements.js recreates only an initial 22-record batch; do not use it to overwrite the current expanded supplements. Getting started Requirement: Node.js 22 or newer.
node src/cli.js build
node src/server.js Open http://127.0.0.1:3000 in your browser. Run the automated tests with: node --test --experimental-test-isolation=none In a standard Node.js environment, legacy Phase 2 scripts also document npm test, npm run build, and npm start. Set PORT to change the server port. EPA data refresh (advanced) node src/cli.js import 2024 2026 --refresh node --test --experimental-test-isolation=none node src/cli.js build Without --refresh, the importer reuses the cached data/epa.csv. Standard imports reapply vetted manufacturer supplements when identities match. Avoid --epa-only for normal updates: it temporarily leaves out enriched manufacturer fields. The genetic-algorithm experiment (historical Phase 2) We also built a separate Car DNA prototype to explore whether a vehicle recommendation problem could be expressed as evolution toward a personalized target. Representing a vehicle's “DNA” The experimental engine mapped user preferences into 8 preference groups and 13 normalized features: price, horsepower, torque, acceleration, energy consumption, electric range, seats, cargo capacity, vehicle length, total cost of ownership, charging/refueling convenience, tailpipe CO₂, and safety rating. Unknown fields were excluded from applicable scoring instead of being fabricated. Evolving an ideal profile The prototype used a reproducible genetic algorithm with:
- 40 individuals per generation
- 40 generations
- Fixed random seed: 42
- Random initialization, fitness scoring, tournament selection, uniform crossover, mutation, and elitism The algorithm searched an abstract parameter space for a preference-matched ideal, then compared that hypothetical target with known real vehicles. An evolved virtual profile is not a manufacturable vehicle and is never inserted into the real-vehicle database. The prototype recorded actual best and average fitness values by generation; its chart was not a fabricated animation. Research limitation: This prototype has not been calibrated against actual purchase feedback and has not demonstrated that genetic optimization beats alternative ranking methods. The current V2.1 website and its main /api/recommend route do not use this GA. Earlier Phase 2 features Historical prototype work also explored:
- Fuel and electricity cost estimates using driving distance and user-supplied rates.
- User-scenario total cost of ownership (TCO), keeping insurance, maintenance, depreciation/resale, and other unknown amounts explicitly separate from verified vehicle facts.
- Three principal vehicle suggestions, alternatives, visible data coverage, and an evolution/fitness chart.
- Optional coordinate-to-coordinate road routing through the OSRM Route API only with explicit consent. The historical routing feature did not provide a full interactive map, live traffic, or charging-station routing. These describe the earlier experimental implementation, not a promise that each feature is present in the V2.1 user interface. Testing and quality checks The project maintains automated checks for vehicle-data validation, source consistency, eligibility rules, missing values, rank stability, weighting, comparison behavior, and HTTP endpoints.
- V2 acceptance record: 57 passing tests, including student, seven-seat family, performance, EV commuter, and no-match scenarios. The seven-step V2 flow and comparison were exercised in a browser; actual physical-device testing was not claimed.
- Historical Phase 2: At successive milestones, test suites grew from 33 to 37, 44, 48, and 49 passing tests, as features were added.
- Current V2.1: Acceptance notes and ten-scenario sensitivity/coverage details are documented in
data/v21-report.md. Run the test command above against the present checkout for its current results. Historical test counts are milestone records, not claims that the latest branch has exactly that number of passing tests. Important limitations We want reviewers to understand both what works and what is still in progress: - Incomplete vehicle specifications: EPA coverage is broad, but manufacturer-verified MSRP, seating, performance, and cargo figures cover only a small subset of configurations. Strict filters may therefore return no verified vehicles even when suitable vehicles exist in the real world.
- No verified safety-rating coverage: Do not interpret unavailable safety or comfort dimensions as proven advantages.
- No real-time dealer inventory or transaction pricing. MSRP is a historical manufacturer reference, not an on-road quote.
- No comprehensive model-specific insurance, repairs, resale forecasts, financing, subsidies, or used-car valuations. Historical ownership-cost scenarios use disclosed assumptions.
- No full interactive map, address geocoding, live charger availability, or route-based charging and fuel-stop planning in the current V2.1 flow.
- No lifecycle emissions model: Tailpipe CO₂ is not an estimate of all environmental impacts.
- No GA in the current recommendation flow: The genetic algorithm is a documented prototype, not a hidden engine behind the present results. What's next
- Improve verified coverage. Continue reviewing exact model-year/trim specifications, MSRP, seating, performance, cargo, and licensed imagery.
- Evaluate ranking quality. Test recommendations with representative users and compare deterministic ranking against the historical genetic-algorithm approach.
- Explore sustainable choices more deeply. Add better charging-infrastructure information, electricity/fuel price updates, and carefully sourced broader emissions measurements.
- Build practical trip features. Add appropriate map views, charging and gas stops, route detours, and location-aware costs, with explicit privacy controls.
- Improve real-world affordability comparisons. Expand coverage for insurance, maintenance, repairs, and resale, with transparent confidence and assumptions. Data sources and technical references
- EPA Vehicle Data CSV and EPA API documentation
- 2024 Toyota Prius brochure, 2024 Prius Prime brochure, and 2025 Corolla Hatchback brochure
- 2024 Nissan LEAF press kit and 2025 Nissan LEAF press kit
- Ford Maverick announcement
- OSRM routing documentation
- Repository documentation:
data/v21-report.md,data/coverage-report.md,data/v3/README.md,data/completeness.mdOur guiding idea: The best car isn't the same for everyone. Good recommendations should be personal, explainable, grounded in evidence, and mindful of the environment.