Skip to content

Commit ced2d8f

Browse files
authored
Create Bitmask-Dynamic-Programming.md
Added dp state description
1 parent cbc13e0 commit ced2d8f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Notes/Bitmask-Dynamic-Programming.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public double solve( int bitmask, int pos )
7171
}
7272
```
7373

74+
State of DP:
75+
dp[ bitmask ][ pos ] = The Best cost to travel the un-masked cities , if the last visited city was 'pos'.
76+
7477
If we know that `solve( bitmask, pos )` will give us thge answer to the traveling salesman problem, and we say that we start at city 0, what should our initial function call be?
7578

7679
What is the value of `bitmask`?

0 commit comments

Comments
 (0)