fix: directedKey collision for vertex names containing arrow separator#59
Open
sauravbhattacharya001 wants to merge 1 commit intomasterfrom
Open
fix: directedKey collision for vertex names containing arrow separator#59sauravbhattacharya001 wants to merge 1 commit intomasterfrom
sauravbhattacharya001 wants to merge 1 commit intomasterfrom
Conversation
…FlowAnalyzer directedKey() previously used string concatenation with '->' separator, causing ambiguous keys when vertex names contain '->'. For example, vertices 'A->B' and 'C' produced key 'A->B->C', indistinguishable from vertices 'A' and 'B->C'. Replace all internal Map<String, Double> keyed by directedKey with Map<List<String>, Double> using Arrays.asList(from, to) as the key. This eliminates the collision since List equality is element-wise. Public API (getEdgeFlows) now uses Unicode arrow for display keys. Fixes #45
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #45
Problem: \directedKey(u, v)\ concatenated vertex names with ->, causing ambiguous keys when vertex names contain ->. Example: vertices \A->B\ and \C\ produce key \A->B->C, same as vertices \A\ and \B->C.
Fix: Changed all internal maps from \Map<String, ...>\ to \Map<List, ...>\ using \Arrays.asList(from, to)\ as keys. List equality is element-wise, eliminating collisions entirely.
Changes:
esidualCapacity, \low, \capacity, \�dgeLookup) use \List\ keys