Graph traversal with constraints.

Revision en1, by HOMIARA_RUBY, 2026-05-18 21:11:32

How to solve this problem efficiently? Thanks in advance.

A complete weighted graph has N nodes. Source and End node is same (predefined). You can travel any node any times but not the source node. That means you can leave the source node just once. You want to maximise the sum of edge-weight. The sum of weight must not exceeds the pre given value M.

Determine the maximum sum and write the nodes sequentially.

Can you refer some similar problems so that i can examine the code/ algorithm.

Tags graph, backtracking

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English HOMIARA_RUBY 2026-05-18 21:11:32 534 Initial revision (published)