# Open Travelling Salesman Problem

Hi!

I wanted to use the A* search implementation in MatlabBGL for solving the Open Traveling Salesman problem with a given starting node (i.e. the salesman doesn't have to return to the starting node but just has to cover the whole graph). Can you kindly give me some pointers where I should be looking for additional documentation/examples.

I am trying to understand how to change the stopping criterion in A* from finding the goal node to traveling all the nodes (path length).

Also I would need to add graph properties so if you can share those examples as well.

Thanks a ton!
#M
PS: I am a beginner with these graph libraries but do know matlab

## Question information

Language:
English Edit question
Status:
For:
Matlab BGL Edit question
Assignee:
No assignee Edit question
Last query:
 Revision history for this message David Gleich (dgleich) said on 2010-11-01: #1

Here is the example for astar search.

% goal = 11; % Binghamton
% start = 9; % Buffalo
% % Use the euclidean distance to the goal as the heuristic
% h = @(u) norm(xy(u,:) - xy(goal,:));
% % Setup a routine to stop when we find the goal
% ev = @(u) (u ~= goal);
% [d pred f] = astar_search(A, start, h, ...
% struct('visitor', struct('examine_vertex', ev)));

What you have to change is just remove the stopping criteria:

% [d pred f] = astar_search(A, start, h, struct('visitor', struct()));

I believe that should do what you want.

David