

Isn't A* a path finding algorithm? In that sense using both A* and GA seems a little redundant. Just to take a whack at it, I would suggest using A* to search a possible population of paths generated by the GA.
Alternatively, you could use the GA to position the queen and then A* to calculate the paths.
Like I said, either algorithm should be sufficient, I'm not sure why you need to use both. Any more recent developments since posting the original question?
(I've been absent from the forums as I was taking a Christmas break. )





I called the Prof this morning and I explained to him that what I understood made the assignment a load of rubbish. It turns out I misunderstood. He wants two assignments, both solutions to the nQueens problem, one using SMA* (simplified memory bounded A*) and the other using GA.
Cheers.





Mustafa Ismail Mustafa wrote: He wants two assignments, both solutions to the nQueens problem, one using SMA* (simplified memory bounded A*) and the other using GA.
Ah, that would make more sense. Seems unnecessary (and possibly difficult) to mix the two.





Precisely.
I couldn't understand how he wanted the mix. It does make a lot more sense.
Cursed MSc.





Mustafa Ismail Mustafa wrote: Cursed MSc.
You have much to learn yet, young Masters Student.





Actually, I'm top of my class
It didn't register at the time but I got suspicious when I started reading for the assignment. Didn't make sense, so I posted here and then I called the Prof and he set the record straight.
I'm aiming for the PhD at Queens, I really hope it works out. Computational Biology or Financial Engineering.





Mustafa Ismail Mustafa wrote: Financial Engineering
Interesting you brought that up  since I am a "financial engineer". I would counsel you not to go into it. There have been huge layoffs (150,000+) in the wake of the financial crisis and investment banks are decreasing their activity in this area as most are being merged with their deposit side activities. Combine that with calls for increased regulation of the financial markets and derivatives and the number of jobs available for financial engineers will see a marked decrease.
I am trying to get out of the field myself and it is proving very difficult to find a job. The profession is currently very unpopular  nobody wants to be associated with those thought to be behind the credit crisis.





Really?
I'd have thought that it would pick up after the recession, besides, wouldn't that actually help the financial institutions get back on their feet faster?
I prefer going into Computational Biology, specifically into the modeling and forecasting of diseases and/or chemical reactions in biological entities systems.
You've given me food for thought.
In either case, because of the financial crisis, in the States, many universities have cut down the number of PhD students that they're willing to take on, but come this summer, I'm leaving Jordan to either carry on with the PhD or to get a better paying job in [western] Canada.





Yes. All investment banks are cutting back their quantitative positions. The increased regulation will mean more routine uses of derivative products and less need for people with quantitative backgrounds to invent new products.
It's already happening. In Zurich, for example, there are thousands with backgrounds in financial engineering on the job market. For each job posting they are getting so many applications they can't handle them all. Even the headhunter organizations are telling me not to expect anything until late next year at the soonest and, even then, there will be huge competition for limited positions  those with the most experience will be taken first. It's terrible. Most banks are waiting to see what the "new system" will mean for their risk management operations. That could be two years or more before there's a solid draft and implementation.
I'm trying to get into financial regulation so that when the banks start hiring I'll have some experience.
And it's worse in the U.S. The number of unemployed is in excess of 150,000.





Would you mind if I emailed you later on tonight when I get back home? I'd like to discuss this in greater detail if you don't mind. I would so totally appreciate it.





No problem. I'm GMT+1, so my response could be delayed due to time difference.





Great, I'm GMT +2 so we should be fine





how to calculate shortest path between houses. answer must take into account fully laden sleigh and naughty/nice rating of occupants. urgent!
CODE PLEASE!
Merry Christmas CodeProject





Mark Churchill wrote: how to calculate shortest path between houses
Dijkstra's algorithm for the nice! The longest path algorithm for the naughty!
( Is this a homework question? )
It's a bit past Christmas, so Happy Holidays, Mark!





modified on Monday, February 9, 2009 7:30 PM





I have a problem I can't seem to figure out. I'm trying to code an algorithm which calculates the longest path(s) from a given list of nodes and their neighbor nodes. I've learned a little bit about Djikstra's and the "traveling salesman" algorithms but those are both meant to calculate the shortest distance between two points. The problem statement would basically be "Given a list of nodes and their neighboring nodes (all one unit away), calculate the longest path(s) that can be taken using any given 'segment' only once in each path."
Here's an example. Given this list:
Node : Neighboring Node,Neighboring Node,Neighboring Node
0 : 1,2,9
1 : 0,5,6
2 : 0,3,1
3 : 2,4,1
4 : 3,5,1
5 : 4,1,1
6 : 1,7,1
7 : 6,8,1
8 : 7,9,1
9 : 8,0,1
('1' means no neighboring node)
the algorithm should output:
"015432098761"
"016789023451"
"023451098761"
"023451678901"
"098761023451"
"098761543201"
"102345167890"
"109876154320"
"154320167890"
"154320987610"
"167890154320"
"167890234510"
I've been trying to code this in VB6 but it's gotten very messy and I think I'd like to try coding it in Python to get it working and then convert it to VB6.
My current method starts at a node and "jumps" to a neighbor node until it reaches a node that's already been used once in the current path, and then jumps backwards until it reaches a threeneighbornode and takes the second "fork" of that node until it reaches that end. It does this until it's jumped all the way back to the starting node, and then it chooses another starting node and runs again until all threeneighbor nodes have been started from. I guess it's similar to a treesearching algorithm except the branches can connect to each other.
I've spent a while Googling and haven't found much  most articles I've found deal with finding the shortest path. Any help would be appreciated!





Since you are using a sequence of nodes, you can use the constraint that no node in a potential path can be the same as the previous node. Then objective function is the length of the path.
I dug up some pseudocode:
Pseudocode for Longest Path
Nodes of graph have integer names
Node Extensible( sequence s )
Boolean found, Node endpoint
p = EndOfPath(s)
Set Inpath(x) = true for any x in s
y = LastUsed(p)+1
found = false, q = y
While q <= number of vertices And Not found
found = Not InPath(q) And IsEdge(p, i)
If Not found Then q = q + 1
End While
If Not found Then
Extensible = 1
Else
Extensible = q
End If
Sequence Truncate( sequence s )
'Reset Lastused for EndofPath of s and remove EndofPath
p = EndOfPath(s)
// p will be removed so reset Lastused
Lastused(p) = 0
If s.length = 1 then
// choose new start vertex
Truncate = s+1 // s is integer name for old start
Else
Truncate = all but last node of s
End If
Sequence Extend( sequence s )
p = EndOfPath(s)
q = Extensible(s)
If q = 1 Then
If s.Length > s*.Length Then s* = s
// backtrack
Extend = Truncate( s )
Else
Lastused(p) = q
Extend = s + q
End If
End If





In your pseudocode, when finding the next node to jump to, it says:
73Zeppelin wrote: // now find first vertex which is :
// not in use in s
// adjacent to p
// >= y
If I'm reading that correctly it will only use nodes which have not already been used in the current path. However, it shouldn't matter how many times any particular node is used but rather how many times each "road" between nodes is used.
In my example, "015432098761" was a valid path. Node '0' is used twice, but each "road" leading to each of its three neighbors is used only once (01,20,09). Am I understanding your pseudocode correctly?
One more question  what does
73Zeppelin wrote: If s.Length > s*.Length Then s* = s
do? Thanks!





zenerguy32 wrote: If I'm reading that correctly it will only use nodes which have not already been used in the current path. However, it shouldn't matter how many times any particular node is used but rather how many times each "road" between nodes is used.
In my example, "015432098761" was a valid path. Node '0' is used twice, but each "road" leading to each of its three neighbors is used only once (01,20,09). Am I understanding your pseudocode correctly?
Ah, okay. Yes, the algorithm allows traversal through a vertex only one time. You are allowing multiple traversals?
zenerguy32 wrote: 73Zeppelin wrote:
If s.Length > s*.Length Then s* = s
do? Thanks!
This is just used for backtracking.





Correct  I am allowing multiple traversals through each node, but only one traversal using each "road" (for any given path).





hi
I want to implement data versioning in a application...
I need a Delta algorithm component.
where can I find it?
thanks.





mkhansari wrote: hi
I want to implement data versioning in a application...
I need a Delta algorithm component.
where can I find it?
thanks.
Google, maybe?





thanks very very very much
who can help me such as you?
Mohammad Khansari





Hi,
I have a double value describing rotation angle for a text box object. I need to convert it to quaternion. I have searched the web, and all I get is converters that conver Euler angle to Quaternion.
I would appreciate any formulae or algorithm.
And this double value is the only information I have for rotation.
Regards,
Shoaib
Its never over !





shaibee wrote: have a double value describing rotation angle for a text box object. I need to convert it to quaternion. I have searched the web, and all I get is converters that conver Euler angle to Quaternion.
I would appreciate any formulae or algorithm.
And this double value is the only information I have for rotation.
You want to convert an axis angle, for example? A rotation around an axis in space can be converted to a quaternion Q(w,x,y,z) . If the rotation is given by a unit vector (ax, ay, az) and the angle theta is in radians, then the conversion is:
w = cos(theta/2)
x = ax * sin(theta/2)
y = ay * sin(theta/2)
z = az * sin(theta/2)
Make sure the axis is normalized before conversion. If there is no rotation, the quaternion is the rotation identity quaternion.




