Search found 5 matches

by bruk
Thu Aug 31, 2006 9:16 pm
Forum: Algorithms
Topic: dynamic programming problem
Replies: 0
Views: 1284

dynamic programming problem

Hi! I have this problem and I am not sure how to solve it.
I have a vector of integers V and a number W.
Using all the numbers in V, I have to put between every number a plus or a minus or a multiplication so doing the calculations in V I get W.
between every number of V you have a parenthesis, so ...
by bruk
Wed Jul 19, 2006 6:04 am
Forum: Algorithms
Topic: Graph problem
Replies: 12
Views: 5483

Tanu:
I get the idea, but I am still thinking how to adapt my algorithm to use previous information that I have calculated. I really don't know how.

ayon:
You are right, but in the problem that I am actually trying to solve (CAMELOT) the board can be of (25x40) and I have to calculate for all the ...
by bruk
Tue Jul 18, 2006 2:24 am
Forum: Algorithms
Topic: Graph problem
Replies: 12
Views: 5483

THANKS!!!!!! :D :D
ok...I changed my code:


here it is:

void calc(int stx,int sty,int x, int y, int costKnight[27][42][27][42],int dist){
int r,c;
r=x+2;
if(r<=R){
c=y+1;
if(c<=C && costKnight[stx][sty][r][c]>dist){
costKnight[stx][sty][r][c]=dist;
calc(stx,sty,r,c,costKnight,dist+1 ...
by bruk
Mon Jul 17, 2006 5:32 am
Forum: Algorithms
Topic: Graph problem
Replies: 12
Views: 5483

thanks a lot for your help!! I really appreciate it.
That is something I was trying to do...but I don't know how to make it
Here is my best try...but it doesn't work


#include <stdio.h>
#include <stdlib.h>
#define MIN(a,b) a<b?a:b
int R,C; //rows and cols
bool used[30][30];

int MIN4(int a, int b ...
by bruk
Mon Jul 17, 2006 12:43 am
Forum: Algorithms
Topic: Graph problem
Replies: 12
Views: 5483

Graph problem

I don't know if it is exactly a graph problem, maybe it could be solved in another way...
the problem is, if you have a chess board with a Knight, I need to know (in the fastest way) the short distance to get to another position of the board with this Knight...
(The knight can only makes 8 moves ...

Go to advanced search