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

perf: use double instead of float for edge weights - #87

Closed
sauravbhattacharya001 wants to merge 1 commit into
masterfrom
perf/edge-double-weight
Closed

sauravbhattacharya001 wants to merge 1 commit into
masterfrom
perf/edge-double-weight

Conversation

@sauravbhattacharya001

Copy link
Copy Markdown
Owner

Edge weight was stored as float but every algorithm operates on double internally, causing implicit widening on every getWeight() call in hot loops. Changes weight field to double and parser to Double.parseDouble.

The edge weight field was stored as float but every algorithm
(Dijkstra, Louvain, ForceDirected, PageRank, etc.) operates on
doubles internally. This caused implicit float-to-double widening
on every getWeight() call in hot loops.

Changes:
- edge.java: weight field float -> double, getter/setter updated
- GraphFileParser: Float.parseFloat -> Double.parseDouble for
  precision and to avoid widening on store
- All existing float literal callers auto-widen safely (no source
  changes needed)
@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/s labels Mar 18, 2026
@sauravbhattacharya001

Copy link
Copy Markdown
Owner Author

Closing: superseded or conflicting with newer changes already on main/master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

size/s visualization Graph visualization and UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant