-
as seen on Programmers
- Search for 'Programmers'
Recently I competed in nation wide programming contest finals. Not unexpectedly all problems were algorithmic. I lost (40 points out of 600. Winner got ~300). I know why I lost very well - I don't know how to find actual problem in those obfuscated tasks which are life-blood of every competition.…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I'm trying to implement a genetic algorithm that will calculate the minimum of the Rastrigin functon and I'm having some issues.
I need to represent the chromosome as a binary string and as the Rastrigin's function takes a list of numbers as a parameter, how can decode the chromosome to a list of…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
I am developing a chess program. And have made use of an alpha beta algorithm and a static evaluation function. I have successfully implemented both but I want to improve the evaluation function by automatically tuning the weights assigned to its features. At this point am totally confused about the…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
I'm new to coding , learning it since last year actually.
One of my worst habits is the following:
Often I'm trying to create a solution that is too big , too complex and doesn't achieve what needs to be achieved, when a hacky kludge can make the fit.
One last example was the following (see paste…
>>> More
-
as seen on Programmers
- Search for 'Programmers'
I want to make a solution to find the optimum route of school visit. For example, I want to visit 5 schools (A, B, C, D, E) in my city. Then I must find out what school I should visit first, then the second, then the third etc. with distance, time, and cost criteria. The problem is, I am confused…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
My understanding of basic BFS traversal for a graph is:
BFS
{
Start from any node . Add it to que. Add it to visited array
While(que is not empty)
{
remove head from queue. Print node;
add all unvisited direct subchilds to que; mark them as visited
}
}
However, if we have to…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi All,
I am working on a problem that I need to find all the shortest path between two nodes in a given directed unweighted graph. I have used BFS algorithm to do the job, but unfortunately I can only print one shortest path not all of them, for example if they are 4 paths having lenght 3, my algorithm…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Wikipedia about DFS
Depth-first search (DFS) is an
algorithm for traversing or searching
a tree, tree structure, or graph. One
starts at the root (selecting some
node as the root in the graph case)
and explores as far as possible along
each branch before backtracking.
So is BFS?
…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Dear Everyone
I am interested in finding a path (not necessarily shortest) in a short amount of time. Dijsktra and AStar in networkx is taking too long.
Why is there no DFS or BFS in networkx?
I plan to write my own DFS and BFS search (I am leaning more towards BFS because my graph is pretty deep)…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I understand BFS, and DFS, but for the life of me cannot figure out the difference between iterative deepening and BFS. Apparently Iterative deepening has the same memory usage as DFS, but I am unable to see how this is possible, as it just keeps expanding like BFS.
If anyone can clarify that would…
>>> More