Skip to content

[WS3 | Phase 3] DistanceEngine — Flat relation-keyed matrices (→ WS5) #243

Description

@oxy86

Part of: [WS3] Domain Model Split (to be linked)
Roadmap: docs/roadmaps/roadmap_domain_model_split.md · docs/roadmaps/roadmap_matrices_modernization.md
Depends on: #242 (Phase 2)

Goal

Replace GraphVertex::m_distance and GraphVertex::m_shortestPaths (per-vertex QHash stores, keyed by target vertex and relation) with a centralised QHash<int, Matrix> on Graph (keyed by relation), using the existing SocNetV Matrix class.

Why

  • Eliminates per-vertex QHash lookup overhead in the back-propagation inner loop (shortestPaths(v1) called per predecessor per vertex per source)
  • Makes APSP write-back in Phase 2 a flat array write: distMatrix[rel][si * N + ti] = d
  • Removes the per-vertex mutex array introduced in Phase 2 (each source owns its own row — no contention at all)
  • Aligns with WS5 goals: cancellable, testable matrix subsystem

Tasks

(To be detailed when Phase 2 is complete and WS5 is scoped)

  • Define centralised QHash<int, Matrix> on Graph for APSP results
  • Update DistanceEngine write-back to use flat matrix rows
  • Remove per-vertex m_distance / m_shortestPaths hashes from GraphVertex
  • Remove per-vertex mutex array from Phase 2
  • Update all callers of the vertex distance/shortest-paths API
  • All regression baselines pass

Note

This phase is delegated to WS5 (Matrices Modernization). It is listed here to show the full arc and to mark the dependency.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions