Skip to content

Add empty-solution guards to TSP and Hamiltonian visualizations#313

Merged
wrigjl merged 1 commit into
CSharpAPIfrom
bugfix/tsp-hamiltonian-visualization-empty-solution-guard
Jun 19, 2026
Merged

Add empty-solution guards to TSP and Hamiltonian visualizations#313
wrigjl merged 1 commit into
CSharpAPIfrom
bugfix/tsp-hamiltonian-visualization-empty-solution-guard

Conversation

@Trosper3

Copy link
Copy Markdown
Contributor

SolvedVisualization() called parseNodeListWithStringFunctions without checking whether solve() returned an empty result. An empty or "{}" solution caused TSP to incorrectly color every graph node as Solution (the all-nodes loop ran unconditionally) and left both visualizations open to operating on a single-element list containing an empty string.

The guard returns the unsolved graph view immediately when the solution is empty, "{}", or produces no valid node names after parsing.

SolvedVisualization() called parseNodeListWithStringFunctions without
checking whether solve() returned an empty result. An empty or "{}"
solution caused TSP to incorrectly color every graph node as Solution
(the all-nodes loop ran unconditionally) and left both visualizations
open to operating on a single-element list containing an empty string.

The guard returns the unsolved graph view immediately when the solution
is empty, "{}", or produces no valid node names after parsing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@wrigjl wrigjl merged commit 21efe53 into CSharpAPI Jun 19, 2026
6 checks passed
@wrigjl wrigjl deleted the bugfix/tsp-hamiltonian-visualization-empty-solution-guard branch June 19, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants