Heuristics: Representation of Search Space and Neighborhoods 1
Inhaltsverzeichnis
Search Problems in General
The primary difference between an optimization problem and a search problem is, that the search problem concentrates on the variables you have to fill in for the optimal function value, whereas the optimization problem only focuses on the optimal value itself.
Search spaces are defined by the following:
|
See below.
|
Search Spaces
There are multiple definitions of the Search Space. You can divide it into infinite and finite search spaces and in solution and problem spaces.
Finite Search Spaces
The finite search space is characterized by his finite amount of nodes and edges. You can use algorithms or heuristics to find the best solution, but if you have a finite but big search space it is often more efficient to use an heuristic due to the shorter runtime.
Infinite Search Spaces
The infinite search space is characterized by his infinite amount of nodes and edges. You can only use heuristics to find the optimal solution. If we would use algorithms in infinite search spaces, they would not terminate, as there are infinite possibilites to form a solution. Heuristics have the advantage that they do not compute every last possibility but rather trie to narrow down the good solutions, so use heuristics to handle with infinite search spaces.
Solution Spaces
In the solution space, the objective function defines a preference order over the solutions shown. There are already potential solutions ( e.g. valid tours of a TSP) which are resembled by the nodes of the graph. The edges between the nodes visualize the transition from a given solution to a new (neighboring) solution.
As you can see below, the problem space can be portrayed as a non-directed graph.
Problem Spaces
In the problem space the nodes resemble the problems and sub-problems. The root of the tree is the initial problem while the interim nodes are the subproblems. The leaves represent the solutions. The edges are the decomposition of a problem into a simpler sub-problem.
As you can see below, the problem space can be portrayed as a spanning tree.
Neighborhoods in General (Mathematically)
In directed Graphs
Let Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): G= \left ( V, R, \alpha, \omega \right )
be the directed graph
with the functions Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \alpha: R \rightarrow V
and Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \omega: R \rightarrow V which define starting and end node
Let Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): v \in V
be a node of , then you could define:
- Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \delta_{G}^{+}(v) = \left \{ r \in R \mid \alpha(r) = v \right \}
set of outgoing arcs of
- Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \delta_{G}^{-}(v) = \left \{ r \in R \mid \omega(r) = v \right \}
set of incoming arcs of
- Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): N_{G}^{+}(v) = \left \{ \omega(r)\mid r \in \delta_{G}^{+}(v) \right \}
set of successors of
- Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): N_{G}^{-}(v) = \left \{ \alpha(r)\mid r \in \delta_{G}^{-}(v) \right \}
set of predecessors of
Two nodes Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): u,v \in V
are called adjacent also known as neighbored if there exists an arc with and Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \omega(r)=v or and Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \omega(r)=u
. Therefore you could declare the Neighbordhood of as Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): N(v) = N_{G}^{+}(v) + N_{G}^{-}(v)
In undirected Graphs
Let bet the undirected graph with the function Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \gamma : E \rightarrow V * V
which defines the two end nodes of the edge
Two nodes Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): u,v \in V
are called adjacent also known as neighbored if there exists an edge with .
Therefore you could declare the Neighbordhood of as Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): N(v) = \{ u \in V \mid \gamma(e) = \{ u, v \}\} .
Conclusion
Two nodes are neighbored if there is an arc respectively an edge which connects both nodes.
If you want the neighborhood of a set of nodes you take a look at the neighborhoods of single nodes and sum them up.
Heuristics in reference to Search Space and Neighborhoods
Opening procedures
Opening procedures construct a feasible solution with the help of algorithms.
A few examples for opening procedures:
- Nearest Neighbor
- Double-sided nearest Neighbor
- Nearest Neighbor
- Nearest Addition
- Nearest Insert
- Cheapest Insert
- Farthest Insert
Improving procedures
Improving procedures take these feasible solutions and try to further improve them.
A few examples for improving procedures:
- 2-Opt
- 3-Opt
- R-Opt
- 2-Nodes-Opt
The Nearest-Neighbor-Algorithm
In General
The algorithm belongs to the category of "greedy-algorithms" and has a runtime of .
Let be the undirected and weigthed graph and
- Set
- Regarding the Neighborhood of the nodes of T: Chose the edge with a minimum of weight from Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): v \in V \setminus T
to Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): u \in T the node you have chosen least
- Add to
- Repeat step (2) and (3) until
- Take the edge which connects the starting node with the last node you have chosen
Example
The Search Problem in reference to the example
|
All nodes {A,B,C,D,E,F} - therefore it is a finite Problem Space
|
Initial state
Here we have a classic (strongly simplified) Traveling Salesman Problem which we want to solve by using the nearest neighbor heuristic. As the nearest neighbor heuristic is just an opening procedure, we will not get a particularly good value of the objective function and therefore no particularly good travelling route itself. But the solution we are going to find will be a more or less good foundation from which you could further improve the solution by using improving procedures. There are no weighted edges between the nodes shown yet despite them existing already.
Iteration steps
Here, we randomly pick on of the nodes (in this case node E) to be our starting node from which we will iterate further. The edges from E to any other node is now presented by the lines and the weights are shown as numbers above them. As you can see, the weights differ from edge to edge and because we want to find a preferably short route through all the edges we choose the edge with the smallest weight from E to another node. We are confronted by a special case of the nearest neighbor heuristic: Two edges share the smallest weight. As the algorithm is not particularly foreshadowing we can now choose randomly between the two smallest edges.
We chose node C and are now confronted by new edges between C and all other nodes we have not been to yet. The shortest route beginning from C would now be to A.
Iterate the last steps:
This goes on until we reach the final node that has not been visited yet, in this case node F. Now, as we have a Travelling Salesman Problem, we just need to close the cycle by connecting the last node with the starting node.
Summary
With this, the algorithm from the nearest neighbor heuristic has ended and we found an opening travelling route from which we can further improve our round trip. The last step would now be the accumulation of the weights on the travelled edges and we got the value of our route.
In this case: 2+2+3+5+1+6 = 19
The solution we want to present is: Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): E\rightarrow C \rightarrow A \rightarrow B \rightarrow D \rightarrow F\rightarrow E
Sources
Scripts:
- Operations Research - Prof. Dr. Oliver Wendt (SS 2013)
- Introduction to Network Optimization - Dr. Clemens Thielen (SS 2013)
Books:
- Optimierung, Operations Research, Spieltheorie - Karl Heinz Borgwardt
- Lineare Optimierung und Netzwerkoptimierung - Horst W. Hamacher und Kathrin Klamroth
- Einführung in Operations Research - W. Domschke und A. Drexl
Internet:
About:
- Brought to you by Anna Pfeiffer, Markus Kaiser and Viktor Barie