Combinatorial Search and Heuristic Methods Flashcards

1
Q

What is backtracking?

A

Backtracking is a systematic way to iterate through all the possible configurations
of a search space.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Typically, when would you use backtracking?

A

When there are multiple solutions to a problem and you want to return multiple solutions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Write out the common back tacking algorithm

A

bool finished = FALSE; /* found all solutions yet? /
backtrack(int a[], int k, data input)
{
int c[MAXCANDIDATES]; /
candidates for next position /
int ncandidates; /
next position candidate count /
int i; /
counter */
if (is_a_solution(a,k,input))
process_solution(a,k,input);
else {
k = k+1;
construct_candidates(a,k,input,c,&ncandidates);
for (i=0; i

How well did you know this?
1
Not at all
2
3
4
5
Perfectly