Skip to content

Commit

Permalink
visualization correction
Browse files Browse the repository at this point in the history
  • Loading branch information
sharma-n committed May 17, 2020
1 parent 88d4f54 commit 5f3d127
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 6 deletions.
26 changes: 21 additions & 5 deletions 6. Multi Objective Optimization & NSGA II.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"**Pareto Optimality**: A solution $x^*$ is pareto optimal if there does not exist a solution $x'\\in D$ which dominates $x^*$.\n",
"\n",
"**Pareto Front**: The set of all pareto optimal solutions is called the pareto front. Hence the aim of a multi objective optimization algorithm is to deduce the pareto front or a near optimal pareto front. Below is an example fo a pareto front:\n",
"\n",
"![A pareto front](Images/pareto_front.png)\n",
"\n",
"## II. Solving MOO Problems\n",
Expand All @@ -32,6 +33,7 @@
"* Diversity: Find a good spread of solutions of the front\n",
"\n",
"The techniques can be broadly divided into two approaches:\n",
"\n",
"![Taxonomy of appraoches to solving MOO problems](Images/MOO_techniques.png)\n",
"\n",
"1. **Classical approach**:\n",
Expand All @@ -48,7 +50,9 @@
" Disadvantages:\n",
" * Must solve a single optimization problems many times.\n",
" * Solution highly depends on the values of $R_i$ chosen. It has to be carefully chosen so that it lies within the feasible objective space.\n",
"\n",
" ![Selecting the ideal $R_i$ for constrained MOO](Images/constrained_moo.png)\n",
"\n",
" Here, it can be seen that the solution will depend entirely on the value of $R_i$. For $R_i = \\epsilon_4$, then the solution will be point C. Similarly, $R_i = \\epsilon_3 \\to B$, $R_i = \\epsilon_2 \\to A$. If $R_i = \\epsilon_1$, then we will not be able to find any solution at all.\n",
"2. **Multi Objective Approach**: Using an ideal multi-objective optimizer, achieve **multiple trade-off solutions**. Choose one among these trade off solutions using some higher level knowledge. These methods usually apply evolutionary algorithms.\n",
"\n",
Expand All @@ -58,13 +62,15 @@
"* It uses the frot to determine fitness\n",
"* It examines the distance between points close together on a front to determine fitness.\n",
"Below is the overall framework of NSGA.\n",
"\n",
"![NSGA-II Framework](Images/NSGA_Framework.png)\n",
"\n",
"### Sorting the population into \"Fronts\"\n",
"1. Sort the population into solutions of \"non-dominated fronts\". The first such front is the Pareto optimal solution, i.e., all the points fromFrant 1 are non-dominated by all other points in the solution space.\n",
"2. Generate teh 2nd frot by reomving all points from the 1st front and re-computing the pareto optimal solution. The points on this 2nd Pareto optimal curve are the 2nd front.\n",
"3. Repeat until $n$th front, removing all the points from the $1$st to $(n-1)$th fronts and finding the Pareto optimal for the remaining points.\n",
"For example, if we are trying to minimize two functions $f_1$ and $f_2$, then below could be the different fronts obtained.\n",
"\n",
"![Example of Pareto optimal fronts in NGSA](Images/nsga_fronts.png)\n",
"\n",
"### NSGA II - Handling Diversity\n",
Expand All @@ -83,7 +89,9 @@
"1. Do crossover on the population (of size $N$) and generate a set $Q_t$ of $N$ offspring, where $t$ is the generation number.\n",
"2. Combine the set of parents and children into a new set $R_t$\n",
"3. Do sorting as shown below and generate a new population of parents $P_{t+1}$ of size $N$\n",
"![Elistism in NSGA](Images/nsga_elitism.png)\n",
"\n",
"![Elistism in NSGA](Images/nsga_elitism_algo.png)\n",
"\n",
"This approach has the following advantages:\n",
"* A good population is mantained by the elitism, which saves the best parents by letting them compete with the offspring.\n",
"* Diversity among non-dominated solutions is introduced by the crowding comparison procedure, wich is used with the tournament selection during the population reduction phase.\n",
Expand All @@ -97,9 +105,11 @@
"1. If solution $i$ has a better rank, that is, $r_i < r_j$\n",
"2. If they have the same rank but solution $i$ has a better crowding distance than solution $j$, that is, $r_i = r_j$ and $d_i > d_j$\n",
"Below is defined the `crowding_distance_assignemnt()` function, which takes as input the non-dominated set (a front) $\\mathcal{I}$:\n",
"\n",
"![Crowd distance algorithm for NSGA II](Images/nsga_crowding_algo.png)\n",
"\n",
"The above function is equivalent of calculating for the $i$th solution, in it's front (marked with solid circles), the average side-length of the cuboid.\n",
"\n",
"![Crowd distance cuboid](Images/nsga_crowd_cuboid.png)\n",
"\n",
"We keep in mind that crowding is used to determine BOTH:\n",
Expand All @@ -108,16 +118,22 @@
"\n",
"## IV. Visualiation of Multi-Objective Solutions for more than 2 Objectives\n",
"For MOO problems, we have two desired properties: converge and even distribution. Therefore, for any solution, we can have two types of errors:\n",
"\n",
"![Types of errors in MOO problems](Images/moo_errors.png)\n",
"\n",
"As seen above, these errors can be easily visualized for the 2 objective function case. However, if we have more than 2 objective function, this becomes diffcult. Below are some methods that can be used to visualize solutions for more than 2 objectives:\n",
"1. Scatter plot visualization: In each box, two objectives are plotted in any one time. The diagonal represents which function is being drawn.\n",
"![Scatterplot visualization](Images/moo_scatterplot.png)\n",
"\n",
"![Scatterplot visualization](Images/moo_scatter.png)\n",
"\n",
"2. Value Path visualization: Each line represents a single solution on the Pareto front. The objective values are plotted after normalization. From the example below, you see that objective 1 and 3 arerelated int eh same direction, whereas objective 2 is a competing objective.\n",
"![Value Path visualization](Images/moo_value_path.png)\n",
"\n",
"![Value Path visualization](Images/moo_valuepath.png)\n",
"\n",
"3. Bar Chart method: Every pareto optimal is plotted as a bar graph for each of the objective functions seperately.\n",
"4. Star coordinate visualization: Each solution has a circle, and each of the radial line is the function value of that objective for that solution.\n",
"![Star coordination visualization](Images/moo_star_chart.png)"
"\n",
"![Star coordination visualization](Images/moo_star.png)"
]
},
{
Expand Down Expand Up @@ -149,4 +165,4 @@
},
"nbformat": 4,
"nbformat_minor": 2
}
}
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Global optimization attempts to find the global minima / maxima of a function or
## Some visualizations
* **Simulated Annealing:** Below we see the comparison between simulated annealing (SA) and greedy search (GS) on an example objective. The search algorithm attempts to minimize the function based on two variables. In the image, green areas are maximas and purple areas are minimas, with the intensity representing magnitude.

![Simulated Annealing example](Images/simulated_annealing.png)
![Simulated Annealing example](Images/SA_demo.png)

* **Genetic Algorithsm**: Below shows the evolution of the solutions for two problems solved using genetic algorithms: path finding and travelling salesman problem:

Expand Down

0 comments on commit 5f3d127

Please sign in to comment.