<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/buffet-lines-are-terrible-but-let-s-try-to-improve-them-using-computer-simulations-fjtlvjxnx" -->

---
title: Buffet lines are terrible, but let's try to improve them...
description: A developer simulates buffet line systems using Python to find the most efficient queuing method. Four approaches are compared: the classic single-file line, a...
canonical: https://daily.dev/posts/buffet-lines-are-terrible-but-let-s-try-to-improve-them-using-computer-simulations-fjtlvjxnx
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Buffet lines are terrible, but let's try to improve them using computer simulations | daily.dev
og:description: A developer simulates buffet line systems using Python to find the most efficient queuing method. Four approaches are compared: the classic single-file line, a...
og:url: https://daily.dev/posts/buffet-lines-are-terrible-but-let-s-try-to-improve-them-using-computer-simulations-fjtlvjxnx
og:image: https://api.daily.dev/og/posts/FJTlVJxnX.png
og:image:alt: Buffet lines are terrible, but let's try to improve them using computer simulations
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Buffet lines are terrible, but let's try to improve them using computer simulations

**[Erik Bernhardsson](https://daily.dev/sources/erikbernhardsson)** · 9 min read · 0 upvotes · 0 comments

## Summary

A developer simulates buffet line systems using Python to find the most efficient queuing method. Four approaches are compared: the classic single-file line, a rogue free-movement method, a 'don't go backwards' method, and perpendicular lines. Using Dijkstra's shortest path algorithm and queue stability analysis, the 'don't go backwards' method emerges as the most efficient, handling the highest arrival rates before gridlock. Additional experiments show that making food accessible from both sides further increases throughput. The simulation ran on AWS due to Python's slowness with repeated pathfinding on large grids.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://erikbern.com/2019/10/16/buffet-lines-are-terrible.html>

## Similar posts on daily.dev

- [I got paid minimum wage to solve an impossible problem.](https://daily.dev/posts/i-got-paid-minimum-wage-to-solve-an-impossible-problem--xwckclgfz) · Programming Digest · 85 upvotes · 10 comments
- [Auto-navigating our Grid using Dijkstra's Algorithm](https://daily.dev/posts/auto-navigating-our-grid-using-dijkstra-s-algorithm-damnfl5mm) · Kirupa · 0 upvotes · 0 comments
- [Faster than Dijkstra?](https://daily.dev/posts/faster-than-dijkstra--luk6oiopf) · Hacker News · 3 upvotes · 0 comments
- [The Math Behind Your Commute](https://daily.dev/posts/the-math-behind-your-commute-v7mh7o4ta) · The Palindrome · 3 upvotes · 0 comments
- [Google Interview Question: First Train Is the Wrong Train](https://daily.dev/posts/google-interview-question-first-train-is-the-wrong-train-x881fq9wi) · Medium · 5 upvotes · 1 comments

---

Tags: [#python](https://daily.dev/tags/python), [#data-visualization](https://daily.dev/tags/data-visualization)

[View this post on daily.dev](https://daily.dev/posts/buffet-lines-are-terrible-but-let-s-try-to-improve-them-using-computer-simulations-fjtlvjxnx)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Buffet lines are terrible, but let's try to improve them using computer simulations","url":"https://daily.dev/posts/buffet-lines-are-terrible-but-let-s-try-to-improve-them-using-computer-simulations-fjtlvjxnx","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/buffet-lines-are-terrible-but-let-s-try-to-improve-them-using-computer-simulations-fjtlvjxnx"},"datePublished":"2026-03-26T08:36:25.378Z","dateModified":"2026-03-26T08:39:54.056Z","description":"A developer simulates buffet line systems using Python to find the most efficient queuing method. Four approaches are compared: the classic single-file line, a...","image":"https://media.daily.dev/image/fetch/s---L18G5rm--/f_auto,pg_1,q_auto/https://erikbern.com/assets/buffet/skippable-0.8.gif?_a=BAMAMiZY0","thumbnailUrl":"https://media.daily.dev/image/fetch/s---L18G5rm--/f_auto,pg_1,q_auto/https://erikbern.com/assets/buffet/skippable-0.8.gif?_a=BAMAMiZY0","isAccessibleForFree":true,"articleSection":"Erik Bernhardsson","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Erik Bernhardsson","logo":"https://media.daily.dev/image/upload/s--SlM88DTW--/f_auto,q_auto/v1774514112/logos/erikbernhardsson?_a=BAMAMiWQ0","url":"https://daily.dev/sources/erikbernhardsson"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/buffet-lines-are-terrible-but-let-s-try-to-improve-them-using-computer-simulations-fjtlvjxnx","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"python,data-visualization","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Erik Bernhardsson","item":"https://daily.dev/sources/erikbernhardsson"},{"@type":"ListItem","position":3,"name":"Buffet lines are terrible, but let's try to improve them using computer simulations"}]}
```

