Core algorithm of genetic algorithm [closed] - algorithm

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
What is core algorithm of the genetic algorithm?
What needs to be defined precisely in order to code the algorithm?

You need to define:
The encoding for a solution (e.g. bitstring, tree, etc)
The fitness function - how to quantitatively evaluate the "goodness" of a solution
The crossover operator - a binary function that takes two parent solutions and combines them into a child solution
The mutation operator - a unary function that takes a solution and makes a small change (i.e. mutation) to it
Selection - how do you select individuals for the next generation? This includes the probabilities associated with crossover and mutation.

Related

how to improve the probability of outputing a correct answer? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
A sampling algorithm could output any real number in range [0,1],but the correct answer is in the range [0.1,0.2+x]("x" is in range [0,1]), the algorithm can output a correct answer with probability more than "0.8", then how to give a good answer with high probability? (such as run it many times, and pick the median as the right answer)
I think the question may be asking about the central limit theorem. If the samplings are independent and identically distributed, the OP could apply the classical form: Classical CLT
Otherwise, I recommend viewing the rest of the Wikepedia article to see if any of the other forms are applicable.

Correctness argument for brute force pattern matching? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I was wondering whether the brute force algorithm for pattern matching would have a complex correctness argument?
I was thinking of something along the lines of... If the algorithm is executed fully, this proves its correctness, as each character in the pattern is matched individually to an index in the text string.
Would it be as simple as this?
In general the argument for correctness of a brute-force matching algorithm would be that in the course of its execution it considers every possible way that a string could match a pattern and nothing else; thus if it concludes that the string matches then there is a matching, and if it doesn't then there isn't.

Efficient way to add element to sorted datastructure [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
What is the most efficient way to add an element to a sorted data structure?
Most red black tree packages will have an "insert element" method. If you're not using one already, it might be good to start.
If you're married to a red-black tree implementation that doesn't have an insert element operation, it'd be a good idea to add such a method, possibly from some good red-black tree doc:
http://en.wikipedia.org/wiki/Red%E2%80%93black_tree
BTW, a treap is often quite a bit faster than a red-black tree, but the red-black tree will likely have less variable performance:
http://stromberg.dnsalias.org/~strombrg/python-tree-and-heap-comparison/

Algorithm for ordering a set [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
I have a set of 50 items and many conditions that specificy which element should come before other.
How to I create a ordered list?
Will like it in C# though can translate it from other languages.
Topological Sort
Translate the "many conditions" into a comparison function, and then use that in conjunction with a comparison-based sort (in the general case).
The best comparison-based sorting algorithms are O(nlogn) in the best case. Merge sort is one such algorithm and is pretty easy to implement... there are many others.
If your conditions constitute a partial ordering (rather than a total ordering), Topological sort might be most appropriate.
There are a number of sorting algorithms you can look into. The two that come to mind off the top of my head are the bubble sort and the quick sort.

travelling salesman [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
Where can I find source code for travelling salasman problem?
nowhere, it's not been solved.
You had mentioned that you were having problems with more than 8 or 9 nodes. This isn't surprising because the complexity increases exponentially with each added node.
As a result many solutions involve Genetic programming to gradually evolve a good answer. Finding the best generally requires a brute-force check of all possibilities.
One example is here, which also provides their source code.

Resources