Skip to content

Euclidean generator and tsp enhancements#463

Open
megyhazy wants to merge 5 commits intoboostorg:developfrom
megyhazy:euclidiean_generator_and_tsp_enhancements
Open

Euclidean generator and tsp enhancements#463
megyhazy wants to merge 5 commits intoboostorg:developfrom
megyhazy:euclidiean_generator_and_tsp_enhancements

Conversation

@megyhazy
Copy link
Copy Markdown

Thoughts:

  • Generates complete graph. Does this need to be in the prototype name?
  • There is an example that prints graphs and executes an MST algorithm. Maybe unecessarily complex and can be removed.
  • This is the beginning of refactoring the TSP heuristics to be more modular and have re-usable components vs the way it is now. I intend to refactor metric_tsp and then add nearest_neighbor
  • This is related to issue Euclidian Random Graphs Utilities #452

@megyhazy megyhazy changed the title Euclidiean generator and tsp enhancements Euclidean generator and tsp enhancements Mar 29, 2026
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you deleted the .gitignore file by mistake and committed your changes. This should probably be restored :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the CI to compile and run your tests, the tests should be listed in the test/Jamfile.v2 under the alias graph_test_regular : category :)

[ run generator_test.cpp ]
[ run euclidean_graph_generator_test.cpp ]

const WeightType weight = static_cast<WeightType>(std::hypot(dx, dy));

// No need to check 'inserted' - building fresh complete graph
Edge e = boost::add_edge(*src, *dest, g).first;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like there should be a BOOST_CONCEPT_ASSERT((MutableGraphConcept < VertexListGraph >)); somewhere ?


// Deduce coordinate type from the point container
using PointType = typename PointContainer::value_type;
using CoordType = decltype(std::declval<PointType>().x);
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Defined but not used ?

// Precondition: Graph should have no edges
BOOST_ASSERT_MSG(boost::num_edges(g) == 0,
"connect_all_euclidean requires an empty graph (no edges)");

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe there is a missing precondition that the Point Container should have same size as the graph ?

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