title: Understanding the "Median" in this Graph
body: <p>I tried running the TSP in R using the following code (<a href="https://rstudio-pubs-static.s3.amazonaws.com/132872_620c10f340f348b88453d75ec99960ff.html" rel="nofollow noreferrer">https://rstudio-pubs-static.s3.amazonaws.com/132872_620c10f340f348b88453d75ec99960ff.html</a>):</p>
  <pre><code>library(GA)
  data(&quot;eurodist&quot;, package = &quot;datasets&quot;)
  D &lt;- as.matrix(eurodist)
  
  
  tourLength &lt;- function(tour, distMatrix) {
     tour &lt;- c(tour, tour[1])
     route &lt;- embed(tour, 2)[,2:1]
     sum(distMatrix[route])
  }
  
  #Fitness function to be maximized
  
  tspFitness &lt;- function(tour, ...) 1/tourLength(tour, ...)
  
  GA &lt;- ga(type = &quot;permutation&quot;, fitness = tspFitness, distMatrix = D,
            min = 1, max = attr(eurodist, &quot;Size&quot;), popSize = 50, maxiter = 5000,
            run = 500, pmutation = 0.2)
  
  plot(GA)
  </code></pre>
  <p>This produced the following graph:</p>
  <p>I understand that each point on the x-axis represents the average value and the best value achieved at each iteration (&quot;generation&quot;) - I connected some of these with red lines:</p>
  <p>However, I am having difficulty understanding the significance of the &quot;median&quot; here. I would  have thought that the median would refer to a single point, but it seems like the median here is referring to a &quot;range&quot; of points at each iteration.</p>
  <ul>
  <li>What is the meaning of this &quot;large green shaded region&quot; on this graph and how exactly does it correspond to the &quot;median&quot;?</li>
  </ul>
  <p>Thank you!</p>