Jekyll2020-01-16T17:27:02-05:00https://www.isye.gatech.edu/faculty/Alan_Erera/Alan EreraProfessor of supply chain engineering, operations research, and transportation logistics at Georgia Tech.Alan EreraBaseball Playoff Series Probabilities2018-10-16T22:00:00-04:002018-10-16T22:00:00-04:00https://www.isye.gatech.edu/faculty/Alan_Erera/teaching/2018/10/16/playoff-probabilities<p>Fans of baseball, and more and more often managers and general managers of professional
baseball teams, are known for their interest in <a href="https://www.baseballprospectus.com/">statistics</a>, and also for making
inference on probabilities of future events given statistics summarizing historical
occurrence (although they might not think about this in exactly these terms!). This
is an adoption of the <a href="https://stats.stackexchange.com/questions/31867/bayesian-vs-frequentist-interpretations-of-probability">frequentist</a> interpretation of probability.</p>
<p>I’m a lifelong fan of the
<a href="http://www.espn.com/mlb/team/_/name/bos/boston-red-sox">Boston Red Sox</a>, who tonight
faced a Game 3 battle against the Houston Astros in the 2018 American League Championship
Series. The series was tied 1-1 after two games at Fenway, and the series moved to
Houston for the next 3 games. ESPN previewed Game 3,
<a href="http://www.espn.com/mlb/story/_/id/24989389/your-tuesday-lcs-guide-astros-red-sox-turn-heat-houston-brewers-eye-3-1-lead-los-angeles">and made sure to emphasize</a> how important it is to win Game 3
because when a series is tied 1-1, the team that that wins Game 3 <strong>wins a 7-game MLB postseason series 69% of the time.</strong></p>
<p>Is this a surprising statistic? Well, let’s think about the situation. The team winning
Game 3 has just taken a 2-1 series lead with (at most) 4 games left to play. They
win the series by winning two of the remaining games, while the losing team must win
three. What then is the probability that the team that wins Game 3 wins the series?</p>
<p>Suppose that the two teams are equally matched in each game, regardless of where
the game is played and the current series score. In this case, the likelihood that
the team <script type="math/tex">w</script> with the 2-1 series lead wins any remaining game is <script type="math/tex">p_w = 0.5</script>, and
loses with <script type="math/tex">p_\ell = (1-p_w)=0.5</script>. If you have just learned about the binomial distribution,
you might be tempted to think that the probability that team <script type="math/tex">w</script> wins the series
is given by the binomial probability that they win 2 of the remaining 4 games:</p>
<script type="math/tex; mode=display">\binom{4}{2} (0.5)^2 (0.5)^2 = 6 * \frac{1}{16} = 37.5\%</script>
<p>Intuition indicates that this approach must be wrong; why would the team down 2-1
in the series have a higher likelihood of winning? Another wrong approach is to use
the binomial probabilities again to compute the likelihood that team <script type="math/tex">w</script> <em>loses</em>
3 games, and then to subtract this likelihood from one to determine the likelihood
that they win the series:</p>
<script type="math/tex; mode=display">1 - \binom{4}{3} (0.5)^3 (0.5) = 1 - 4 * \frac{1}{16} = 75\%</script>
<p>This estimate of course is more plausible, since you would certainly guess that team
<script type="math/tex">w</script> with a 2-1 series lead is more likely to win the series. But it is still not
correct.</p>
<p>A safer approach to computing probabilities is to examine the possible events directly.
Let the outcomes of the remaining games be represented by a tuple with an entry <script type="math/tex">W</script>
when team <script type="math/tex">w</script> wins, and <script type="math/tex">L</script> when they lose. Here is the complete set of game
outcome events resulting in team <script type="math/tex">w</script> winning the series: <script type="math/tex">(W,W)</script>, <script type="math/tex">(W,L,W)</script>,
<script type="math/tex">(W,L,L,W)</script>, <script type="math/tex">(L,W,W)</script>, <script type="math/tex">(L,W,L,W)</script>, and <script type="math/tex">(L,L,W,W)</script>. The likelihood of
each of these events depends only on the number of wins and losses in the tuple:
<script type="math/tex">p_w^{count(W)} p_\ell^{count(L)}</script>. Thus, the likelihoods of these events are
respectively <script type="math/tex">\frac{1}{4}</script>, <script type="math/tex">\frac{1}{8}</script>, <script type="math/tex">\frac{1}{16}</script>, <script type="math/tex">\frac{1}{8}</script>,
<script type="math/tex">\frac{1}{16}</script>, and <script type="math/tex">\frac{1}{16}</script>. Adding them together yields <script type="math/tex">\frac{11}{16}</script>,
<strong>or a probability of 68.75%</strong>. Interesting.</p>
<p><strong>Assuming that the two teams have equal likelihood of winning any remaining game
leads to an estimate of the likelihood of a series win for the team with a 2-1 lead
that is essentially equal to the statistic summarizing what is actually observed.</strong>
The hypothesis that teams tied 1-1 after two games are equally likely to win any
remaining game seems consistent with the observed series results.</p>
<p>So what was wrong with the binomial distribution approach to computing the probability?
It is important to remember that the binomial counts successes from exactly <script type="math/tex">n</script>
Bernoulli trials. Setting <script type="math/tex">n=4</script> requires care in this computation, since in many
cases the series is concluded <em>without</em> playing all four remaining games. We can
get the right answers from the binomial if we assume that the unnecessary games will
be played. Then, team <script type="math/tex">w</script> would win the series if they win 2, 3, or 4 games. Similarly,
team <script type="math/tex">\ell</script> would win if they win 3 or 4 games. Yet another way to view this is
that team <script type="math/tex">w</script> will not win the series if they win 0 or 1 more game. But again,
each of these approaches only yields the correct probability if each likelihood is
computed assuming that all four games are played. For example, using the approach
of computing one minus the likelihood that team <script type="math/tex">w</script> wins 1 or 0 additional game:</p>
<script type="math/tex; mode=display">1 - \binom{4}{1} p_w p_\ell^3 - \binom{4}{0} p_\ell^4 = 1 - \frac{1}{4} - \frac{1}{16} = \frac{11}{16}</script>
<p>As I was writing this post, the Red Sox won Game 3 and took a 2-1 series lead!</p>Alan Ereraalan.erera@isye.gatech.eduFans of baseball, and more and more often managers and general managers of professional baseball teams, are known for their interest in statistics, and also for making inference on probabilities of future events given statistics summarizing historical occurrence (although they might not think about this in exactly these terms!). This is an adoption of the frequentist interpretation of probability.Same-day Delivery Dispatching Problems2018-07-23T16:00:00-04:002018-07-23T16:00:00-04:00https://www.isye.gatech.edu/faculty/Alan_Erera/research/2018/07/23/sameday-dispatching<p>Modern last-mile logistics systems are more and more frequently configured to provide rapid order fulfillment directly to consumers. The fastest are the
<em>same-day delivery</em> systems, which promise that e-commerce orders received by a deadline during a day are delivered by the end of the same day (or, in some
cases, within a few hours).</p>
<p>Same-day delivery fulfillment systems intend to provide consumers with the highest level of service in e-commerce. When a consumer places a same-day
delivery order, they receive the product within an <em>order lead time</em> similar to that achieved when making a retail store trip in the afternoon or
evening after the workday. Like any e-commerce order, product availability is known immediately at the order placement time. Additionally, a trip to
the store is not required and it is likely that a larger product catalog is available.</p>
<p>Implementing same-day delivery systems in practice depends on building an effective <strong>vehicle dispatching</strong> plan. Such a plan should specify
whether to operate a dedicated (owned) delivery fleet or whether to rely, at least in part, on outsourced delivery trips. Given this fleet strategy,
the key question is how to assign delivery orders to vehicle dispatches. Once assigned, orders can be sequenced within a dispatch using standard
ideas.</p>
<p>Here at Georgia Tech, Mathias Klapp worked with <a href="https://www2.isye.gatech.edu/~atoriello3/">Alejandro Toriello</a> and me on starting to build an
understanding of vehicle dispatching forsame-day delivery systems in his Ph.D. thesis, completed near the end of 2016.
<a href="https://www.ing.uc.cl/academicos-e-investigadores/mathias-alberto-klapp-belmar/">Mathias</a> is now on the transportation and logistics faculty
at the <a href="https://www.ing.uc.cl/transporte-y-logistica/">Pontificia Universidad Católica de Chile</a>, and the papers from his thesis are now coming out.</p>
<p><img src="https://www.isye.gatech.edu/faculty/Alan_Erera/post_images/2018-07-23-vehicle_dispatching.png" alt="Vehicle Dispatching" class="img-responsive" width="80%" /></p>
<p>The first paper considers a simple setting, where a dedicated single vehicle is available to serve same-day delivery orders <a href="#KET16-1d-ddwp">(Klapp, Erera, & Toriello, 2018)</a>.
This model is appropriate when a delivery region surrounding a distribution point is partitioned among multiple vehicles <em>a priori</em>, and we can
therefore consider the operations of each vehicle separately. We study a key problem in same-day dispatching, specifically when to dispatch the
vehicle during the operating day and with which delivery orders. In typical vehicle routing settings, orders are consolidated over some time period
and then loaded into a vehicle for a single dispatch. Doing so can be quite cost effective, spreading the fixed vehicle dispatch
cost over many orders and also reducing the variable travel costs (typically proportional to miles traveled) per order delivered.</p>
<p>This effectiveness is achieved via <strong>consolidation</strong> of a full day’s worth (in terms of required delivery time) of orders, which in turn requires
that these orders are placed, picked, and packed prior to the operating day. We can try to mimic this approach in the same-day delivery setting,
but it would require that the <strong>order deadline</strong> must occur substantially earlier in time than the <strong>delivery deadline</strong>. For example, to deliver by
8 pm with a 10-hour vehicle shift would mean an order deadline no later than 10 am!</p>
<p>Therefore, we need to develop a better understanding of vehicle routing systems where some orders become ready while vehicles are making other deliveries.
Each vehicle may need to be dispatched from the distribution point multiple times during the operating day. The figure above demonstrates the idea
with a simple timeline. When should we stop waiting and dispatch the vehicle for the first time? Waiting allows
orders to accumulate reducing the delivery cost per order, but simultaneously reduces available vehicle operating time before the
ultimate delivery deadline. Should the vehicle wait after it returns to the distribution point? The figure also makes an assumption
that need not be optimal in practice: that all available orders are loaded onto the vehicle each time it is dispatched. Sometimes it
would be wiser to leave behind some orders that are not geographically compatible with the others, and hope that they
can be grouped with better matches in a later dispatch.</p>
<p>In <a href="#KET16-1d-ddwp">(Klapp, Erera, & Toriello, 2018)</a>, we simplify the problem in one more way: we suppose that all geography in the problem can be modeled by
mapping order delivery locations onto positions along a half-line extending from the distribution point. This approximation allows us to
remove the sequencing complexity found in most routing problems (like the TSP), and focus more squarely on the multiple dispatch questions
above. Why? Because the routing distance required to serve a group of orders is simply twice the distance to the furthest order to be delivered.</p>
<p>For this setting, we formulate a dynamic programming optimization model to determine when to dispatch a vehicle and
with which orders, to minimize the cost of serving orders plus penalties for not providing same-day delivery service to
some orders by the delivery deadline. Solving this DP even with the simplified geometry is very difficult in general when orders are described by a
stochastic process. On the other hand, we show that deterministic variants of the problem where the order release times are known <em>a priori</em> can
be solved with a polynomial dynamic program. We then show that a simple expectation minimization problem that we denote the <em>a priori optimization</em>
problem can be solved with the same approach when order arrival times are modeled with a discrete distribution. The <em>a priori</em> problem is to
select dispatch times and distances for the vehicle in advance for the remaining operating period that minimize expected costs, assuming that
these dispatch times and distances cannot be adjusted. Finally, we use this <em>a priori</em> model and solution approach in a rollout approximation
algorithm for the full dynamic problem in which a new potential dispatch plan is made for the vehicle at every time epoch when the vehicle dwells
at the distribution point.</p>
<p>Please see the paper if you are interested in seeing more of the details. In the next blog post, I’ll discuss more about the results we found
for this problem and extensions to problems with more realistic geography in the follow-up paper, also published in the same
year <a href="#KET17-ddwp-2dgeometry">(Klapp, Erera, & Toriello, 2018)</a>.</p>
<hr />
<p>Here are the papers cited in this post if you’d like to learn more:</p>
<ul class="bibliography" reversed="true"><li><div class="text-justify"><span id="KET16-1d-ddwp">Klapp, M., Erera, A. L., & Toriello, A. (2018). The One-Dimensional Dynamic Dispatch Waves Problem. <i>Transportation Science</i>, <i>52</i>, 402–415. https://doi.org/10.1287/trsc.2016.0682</span></div>
<a href="https://www.isye.gatech.edu/%7eatoriello3/DDWPv2.pdf"><input class="button0" type="button" value="preprint" /></a>
<a href="https://doi.org/10.1287/trsc.2016.0682"><input class="button1" type="button" value="journal" /></a>
<a href="http://doi.org/10.1287/trsc.2016.0682"><input class="button2" type="button" value="doi" /></a>
</li>
<li><div class="text-justify"><span id="KET17-ddwp-2dgeometry">Klapp, M., Erera, A. L., & Toriello, A. (2018). The Dynamic Dispatch Waves Problem for Same-day Delivery. <i>European Journal on Operational Research</i>, <i>271</i>, 519–534. https://doi.org/10.1016/j.ejor.2018.05.032</span></div>
<a href="https://www2.isye.gatech.edu/%7eatoriello3/DDWP2D.pdf"><input class="button0" type="button" value="preprint" /></a>
<a href="https://doi.org/10.1016/j.ejor.2018.05.032"><input class="button1" type="button" value="journal" /></a>
<a href="http://doi.org/10.1016/j.ejor.2018.05.032"><input class="button2" type="button" value="doi" /></a>
</li></ul>Alan Ereraalan.erera@isye.gatech.eduModern last-mile logistics systems are more and more frequently configured to provide rapid order fulfillment directly to consumers. The fastest are the same-day delivery systems, which promise that e-commerce orders received by a deadline during a day are delivered by the end of the same day (or, in some cases, within a few hours).Meal Delivery Routing Problem Instances2018-04-02T17:00:00-04:002018-04-02T17:00:00-04:00https://www.isye.gatech.edu/faculty/Alan_Erera/research/2018/04/02/mdrp-grubhub-instances<p>For the past few years, I have collaborated with my faculty colleague <a href="https://www2.isye.gatech.edu/people/faculty/Martin_Savelsbergh/">Martin Savelsbergh</a>
and Ph.D. students on work with <a href="https://www.grubhub.com/">Grubhub</a>, a leading online and mobile food ordering company. One service that Grubhub
provides is food delivery, and they use a fleet of delivery people (<em>couriers</em>) that pickup orders from restaurants and deliver them to hungry
consumers. This fleet is comprised of individual contractors. Some couriers work preassigned shifts with minimum work (earnings) guarantees, while other
<em>ad hoc</em> couriers sign on like Lyft or Uber drivers when they have time to make food deliveries for Grubhub.</p>
<p><img src="https://www.isye.gatech.edu/faculty/Alan_Erera/post_images/2018-04-02-mdrp_routes.png" alt="Example Routes" class="img-responsive" width="50%" /></p>
<p>Two ISyE doctoral students have worked with us on these problems, first <a href="https://www.linkedin.com/in/ldamian21">Damian Reyes</a> and now Ramon Auad. Damian
focused on the basics of driver management in this scenario, which is complicated primarily by very tight service guarantees and only <em>loosely-controlled</em>
drivers. Ramon is now focusing more on demand management, in the attempt to shape demand when necessary to services that can be performed effectively
by the available driver pool. An initial <a href="https://www.slideshare.net/alerera/optimization-algorithms-for-meal-delivery-operations">talk</a> focused on Damian’s
research was presented at the 1st TSL Conference in Chicago in summer 2017.</p>
<p>One particularly exciting aspect of this research is that our partner, Grubhub, has agreed to let us build public domain representative instances of
the fundamental online driver management problems. These instances are now hosted and available for download at
<a href="https://github.com/grubhub/mdrplib">Grubhub’s public github site</a>. The instances are fully documented, and an evaluation code is provided. The evaluation
code accepts a solution that you might generate for an instance, checks it for feasibility against our primary constraints, and then calculates
performance metrics of your solution. If you are interested in dynamic logistics problems, especially those that
require the routing and scheduling of resources, we encourage you to check out the instances!</p>Alan Ereraalan.erera@isye.gatech.eduFor the past few years, I have collaborated with my faculty colleague Martin Savelsbergh and Ph.D. students on work with Grubhub, a leading online and mobile food ordering company. One service that Grubhub provides is food delivery, and they use a fleet of delivery people (couriers) that pickup orders from restaurants and deliver them to hungry consumers. This fleet is comprised of individual contractors. Some couriers work preassigned shifts with minimum work (earnings) guarantees, while other ad hoc couriers sign on like Lyft or Uber drivers when they have time to make food deliveries for Grubhub.Publications with Jekyll Scholar2018-03-16T14:00:00-04:002018-03-16T14:00:00-04:00https://www.isye.gatech.edu/faculty/Alan_Erera/news/2018/03/16/jekyll-scholar<p>Today, I completed a bit more work on this new website, which now runs with
<a href="https://jekyllrb.com/">Jekyll</a>. To get a publication list up-and-running, I discovered
the <a href="https://github.com/inukshuk/jekyll-scholar">Jekyll Scholar</a> plugin, which provides
support for citations and bibliographies using the BibTex format within the Jekyll
static website environment. There are ways to modify a standard BibTex bibliography to also
be useful as an academic publication list, but it requires “some doing”.</p>
<p>I’m pretty happy with the <a href="https://www.isye.gatech.edu/~alerera/publications">result</a>. I
used some examples from around the web where others have customized the way references are
rendered on the screen to add buttons for links to each paper. Now, when a new paper comes out, I just need to
update the BibTex .bib file with the required information. I’m going to find a way to
organize the preprints for as many of these references as possible, and add links to them
also.</p>Alan Ereraalan.erera@isye.gatech.eduToday, I completed a bit more work on this new website, which now runs with Jekyll. To get a publication list up-and-running, I discovered the Jekyll Scholar plugin, which provides support for citations and bibliographies using the BibTex format within the Jekyll static website environment. There are ways to modify a standard BibTex bibliography to also be useful as an academic publication list, but it requires “some doing”.Global Trade 1012018-01-18T10:56:00-05:002018-01-18T10:56:00-05:00https://www.isye.gatech.edu/faculty/Alan_Erera/logistics/2018/01/18/global-trade-101<p>I’m not an expert in <a href="https://www.cato.org/publications/trade-policy-analysis/americas-maligned-misunderstood-trade-deficit">global trade</a>,
but it is worth thinking a bit about the basic economics these days. For decades, the United States has
led the world in a movement toward fewer trade restrictions, but it certainly appears that protectionism
and trade restraints are now the political fashion here. What will be the result?</p>
<p>We all know by now that the US runs a goods trade deficit; the figure below from the 2013 US Trade
Overview (from the International Trade Administration of DOC) shows a roughly $700 billion goods trade deficit:</p>
<p><img src="https://www.isye.gatech.edu/faculty/Alan_Erera/post_images/2018-01-18GlobalTrade.png" alt="Global Trade Trends" class="img-responsive" width="75%" /></p>
<p>The US runs a services trade surplus, which reduces the total trade deficit somewhere closer to $450-500 billion.</p>
<p><strong>If global trade were a zero-sum game</strong>, then a trade deficit would mean that the US is getting poorer
each year, and net exporters would be getting richer. But global trade is not a zero-sum game, because
economics is not a zero-sum game. The entire point of trade, whether global or local, is to create more
value via a trade transaction than would exist without the transaction; clearly, this is not zero-sum!</p>
<p>A trade deficit, therefore, is just another statistic. It does not tell us much about winners or losers
in the global economy. Policies that seek only to reduce trade deficits are, therefore, pointless.
Restrictions on trade serve to potentially reduce or eliminate the value-creating activity that was the
reason for the trading in the first place. We should be careful to create such restrictions.</p>
<p>Consider a simple example. Suppose the world contained people who live either location A or location B.
People in location A create a single product AP that brings them all the sustenance, joy and happiness
they could ever want. But to create AP, they must first create or acquire product BP.</p>
<p>The net wealth of people in A is simply v(AP) – v(BP), where the subtraction represents the cost of
producing or acquiring BP. Suppose that if BP is produced locally in A, its cost is 3, but if produced
in B, its cost is 1. Let v(AP) be 4.</p>
<p>The net wealth of people in B is most simply measured by some baseline plus v(BP). For each unit of
BP they produce and sell to someone in A, they get net added value of 1. But, a person in A receives
net value of 2 every time she buys a unit of BP from B, rather than produce it herself! In this system,
each time a unit of AP is produced using a purchase of BP from B, a person in A gains 3 units of value,
and a person in B gains 1 unit of value. Thus, in this example, <strong>the wealth of A rises faster than B. But
A runs a continuous trade deficit with location B.</strong></p>
<p>The economic value generated by each transaction in this simple example is +2; that is, 2 units of
value are gained by trade. Each trade is not zero-sum. Location A, with its trade deficit, is earning
a larger share of the benefits. But, indeed, the net wealth of everyone is increasing. Of course, you c
ould also create an example where the location with the trade deficit is increasing its wealth at a
slower rate than its partner. The point is that the existence of the deficit itself is not predictive.</p>
<p>Trade restrictions can certainly help prevent trading partners from increasing wealth, if that were the
primary objective. It remains to be seen whether the US decides to relinquish its position as a
leading proponent of free trade, and whether or not another nation assumes that leadership position.</p>Alan Ereraalan.erera@isye.gatech.eduI’m not an expert in global trade, but it is worth thinking a bit about the basic economics these days. For decades, the United States has led the world in a movement toward fewer trade restrictions, but it certainly appears that protectionism and trade restraints are now the political fashion here. What will be the result?Converted Website to Jekyll2018-01-17T16:50:00-05:002018-01-17T16:50:00-05:00https://www.isye.gatech.edu/faculty/Alan_Erera/news/2018/01/17/site-jekyll-conversion<p>So, for a fun snow day activity, I decided to update my Georgia Tech website using
<a href="https://jekyllrb.com/">Jekyll</a>. My goal was to create a site that I could update a bit
more easily using a variant of <a href="https://daringfireball.net/projects/markdown/">Markdown</a>, which
I suppose is a bit easier to learn than full HTML. A nice feature of Jekyll is that it is
“blog-aware”, which means it is easy to incorporate a nice weblog into your website design.
Jekyll also powers <a href="https://pages.github.com/">Github Pages</a>, which can host your website
for free and is useful to teach your students about.</p>
<p>In my case, my website is hosted by Georgia Tech, so I installed the full Jekyll environment
on my Macbook. This wasn’t too bad, and I learned a bit about Ruby and its gem packaging
system. It seems pretty cool, but I only know the bare minimum at this point. I’ve been
able to test the site design using the local server, and then build the site for
upload to my hosting site; of course, the trick is getting all of the links working
properly.</p>
<p>One neat thing about alternatively using Github Pages as the host is that it is somewhat
easier to configure, and you do not need to install Jekyll locally to produce a
website. You have a bit more control, in my opinion, if you run Jekyll yourself on your
machine, especially if you want to install your website on your school’s server. Using
Jekyll locally is not something I would recommend to a novice programmer, but if you have
some familiarity with building websites, along with some reasonable programming experience,
it should be possible to create something quickly!</p>
<p>Anyways, if I learn anything particularly useful, I might share it in this blog. Please
also excuse any incomplete parts of this site as I get it fully up-and-running!</p>Alan Ereraalan.erera@isye.gatech.eduSo, for a fun snow day activity, I decided to update my Georgia Tech website using Jekyll. My goal was to create a site that I could update a bit more easily using a variant of Markdown, which I suppose is a bit easier to learn than full HTML. A nice feature of Jekyll is that it is “blog-aware”, which means it is easy to incorporate a nice weblog into your website design. Jekyll also powers Github Pages, which can host your website for free and is useful to teach your students about.