Skip to content
This repository was archived by the owner on Jun 18, 2026. It is now read-only.

fix: ensure edge-only vertices are tracked in ParseResult.getVertices() - #117

Merged
sauravbhattacharya001 merged 1 commit into
masterfrom
fix/parser-missing-edge-vertices
Mar 28, 2026
Merged

sauravbhattacharya001 merged 1 commit into
masterfrom
fix/parser-missing-edge-vertices

Conversation

@sauravbhattacharya001

Copy link
Copy Markdown
Owner

Problem

When a graph file contains vertices that only appear in edge lines (not in the
odes\ section), \GraphFileParser\ would add them to the JUNG graph via \�ddEdge(), but they were **missing from \ParseResult.getVertices()**. This means:

  • \graph.getVertexCount() != result.getVertices().size()\
  • Any code iterating \getVertices()\ for export, metrics, or layout would silently skip these nodes

Fix

Explicitly add edge endpoints to both the vertex tracking set and the graph before edge insertion. Uses \Set.add()\ return value to avoid redundant \�ddVertex()\ calls.

Impact

Fixes silent data loss in graph files where not all vertices are declared in the nodes section.

When vertices appear only in edge lines (not in the 'nodes' section),
they were added to the JUNG graph by addEdge() but missing from
ParseResult.getVertices(). This caused inconsistencies where
graph.getVertexCount() != result.getVertices().size(), breaking
downstream code that relies on the vertex set for iteration, metrics,
or export.

Now edge endpoints are explicitly added to both the vertex set and
the graph before edge insertion, ensuring consistency regardless of
whether vertices are declared in the nodes section.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@github-actions github-actions Bot added visualization Graph visualization and UI size/xs labels Mar 24, 2026
@sauravbhattacharya001
sauravbhattacharya001 merged commit 8e9caf7 into master Mar 28, 2026
4 of 8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size/xs visualization Graph visualization and UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant