Click here to Skip to main content
16,008,175 members
Home / Discussions / Algorithms
   

Algorithms

 
Questionshortest paths from s to every vertex of G Pin
nicoletsgr3-Jan-09 10:13
nicoletsgr3-Jan-09 10:13 
AnswerRe: shortest paths from s to every vertex of G Pin
Tony Pottier3-Jan-09 13:27
Tony Pottier3-Jan-09 13:27 
GeneralRe: shortest paths from s to every vertex of G Pin
Tony Pottier3-Jan-09 13:32
Tony Pottier3-Jan-09 13:32 
AnswerRe: shortest paths from s to every vertex of G Pin
valiantljk6-Jan-09 5:07
valiantljk6-Jan-09 5:07 
AnswerRe: shortest paths from s to every vertex of G Pin
Mustafa Ismail Mustafa6-Jan-09 6:10
Mustafa Ismail Mustafa6-Jan-09 6:10 
QuestionA matter of size - the size of the search space Pin
Mustafa Ismail Mustafa30-Dec-08 23:26
Mustafa Ismail Mustafa30-Dec-08 23:26 
AnswerRe: A matter of size - the size of the search space Pin
73Zeppelin31-Dec-08 1:59
73Zeppelin31-Dec-08 1:59 
GeneralRe: A matter of size - the size of the search space Pin
Mustafa Ismail Mustafa31-Dec-08 2:42
Mustafa Ismail Mustafa31-Dec-08 2:42 
73Zeppelin wrote:
The simplest way to restrict a search space is to introduce appropriate constraints.


You mean like a maximum height for example? Or should I be thinking about generating them on the fly?

Like for example, where n == 4, if say the heuristics included that any queen should be in a column by itself, then the current node can generate 4 other nodes only if we follow the heuristic that one and one queen only will be moved up and down the column. This can be aided by the cost function, specifying a node with a greater number of constraints satisfied costing less.


Maybe the diagram expresses it better:

0 = empty
X = queen

when n == 4

A B C D
0 0 0 X 0
1 X 0 0 0
2 0 0 0 0
3 0 X 0 X

(1303 in compressed form)

Can generate any of 16 states (4 queens * 4 potential locations) or 12 states (4 queens * 3 potential locations if we decide that if a queen is chosen it must be moved to a location other than its present one)

So if we chose file D, the generated states to chose from are (generated states = n-1 heuristic):

(original)
A B C D A B C D | A B C D A B C D
0 0 0 X 0 | 0 0 0 X X | 0 0 0 X 0 | 0 0 0 X 0
1 X 0 0 0 | 1 X 0 0 0 | 1 X 0 0 X | 0 X 0 0 0
2 0 0 0 0 | 2 0 0 0 0 | 2 0 0 0 0 | 0 0 0 0 X
3 0 X 0 X | 3 0 X 0 0 | 3 0 X 0 0 | 0 0 X 0 0
(1303) (1300) (1301) (1302)

1302, the last one would have the smallest cost because it has the least number of conflicts, i.e. greatest number of constraints satisfied and it happens that it actually is a solution.

The closed queue's size can be maintained so that the search won't run to infinity.

Am I making sense? To me it seems like a viable solution.

Don't forget to vote if the response was helpful


Sig history

"dad" Ishmail-Samuel Mustafa

"There is no wealth like knowledge, no poverty like ignorance" Ali Ibn Abi Talib

Mustafa Ismail Mustafa wrote:
Keep it up.
Fool.

I now think of you as Mr. T! - Trollslayer

GeneralRe: A matter of size - the size of the search space Pin
73Zeppelin31-Dec-08 3:01
73Zeppelin31-Dec-08 3:01 
Questionmpeg decoding Pin
plewand29-Dec-08 0:31
plewand29-Dec-08 0:31 
AnswerRe: mpeg decoding Pin
bulg29-Jan-09 12:15
bulg29-Jan-09 12:15 
QuestionThis is all about Decision Support System... Pin
surfJul26-Dec-08 5:15
surfJul26-Dec-08 5:15 
AnswerRe: This is all about Decision Support System... Pin
73Zeppelin28-Dec-08 5:24
73Zeppelin28-Dec-08 5:24 
AnswerRe: This is all about Decision Support System... Pin
Alan Balkany28-Dec-08 7:09
Alan Balkany28-Dec-08 7:09 
QuestionCrystal Report Pin
dkkeyan25-Dec-08 22:24
dkkeyan25-Dec-08 22:24 
QuestionA* & Genetic Algorithms Pin
Mustafa Ismail Mustafa25-Dec-08 5:52
Mustafa Ismail Mustafa25-Dec-08 5:52 
AnswerRe: A* & Genetic Algorithms Pin
73Zeppelin28-Dec-08 5:21
73Zeppelin28-Dec-08 5:21 
GeneralRe: A* & Genetic Algorithms Pin
Mustafa Ismail Mustafa28-Dec-08 5:27
Mustafa Ismail Mustafa28-Dec-08 5:27 
GeneralRe: A* & Genetic Algorithms Pin
73Zeppelin28-Dec-08 5:31
73Zeppelin28-Dec-08 5:31 
GeneralRe: A* & Genetic Algorithms Pin
Mustafa Ismail Mustafa28-Dec-08 5:35
Mustafa Ismail Mustafa28-Dec-08 5:35 
GeneralRe: A* & Genetic Algorithms Pin
73Zeppelin28-Dec-08 5:41
73Zeppelin28-Dec-08 5:41 
GeneralRe: A* & Genetic Algorithms Pin
Mustafa Ismail Mustafa28-Dec-08 5:46
Mustafa Ismail Mustafa28-Dec-08 5:46 
GeneralRe: A* & Genetic Algorithms Pin
73Zeppelin28-Dec-08 6:00
73Zeppelin28-Dec-08 6:00 
GeneralRe: A* & Genetic Algorithms Pin
Mustafa Ismail Mustafa28-Dec-08 7:34
Mustafa Ismail Mustafa28-Dec-08 7:34 
GeneralRe: A* & Genetic Algorithms Pin
73Zeppelin28-Dec-08 7:41
73Zeppelin28-Dec-08 7:41 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.