{"course":{"slug":"ai-for-small-business","title":"AI for a Small Business","url":"https://addaly.com/learn/ai-for-small-business","level":"beginner","track":"work"},"lesson":{"slug":"rotas-routes-and-solvers","title":"Rotas and routes: the tools that actually solve them","url":"https://addaly.com/learn/ai-for-small-business/rotas-routes-and-solvers","position":52,"of":88,"minutes":9,"answer":"Rotas, routes and allocation are constraint problems that need a solver, not a generator, so use a spreadsheet solver or OR-Tools for the answer, use the model to elicit the constraints and explain the result.","keyIdea":"Rotas, routes and allocation are constraint problems that need a solver, not a generator, so use a spreadsheet solver or OR-Tools for the answer, use the model to elicit the constraints and explain the result, and always verify with a separate rule-by-rule check."},"body":{"format":"markdown","text":"## A different kind of problem\n\nEverything else in this course is a language problem. A rota is not.\n\n\"Two people on every shift, Ana cannot work Tuesdays, nobody more than five days, Miguel and Sofia not paired, everyone gets one weekend off in three\" is a **constraint satisfaction problem**. Solving it means searching through possible arrangements until one satisfies every rule: a procedure, run by a computer, that either finds a valid answer or proves there is not one.\n\nA language model does not search. It writes a rota-shaped document, and rota-shaped is not the same as valid. Ask it to check its own work and it will confidently confirm the rota it just broke.\n\nThe same applies to delivery routes, packing a van, fitting appointments around travel time, and allocating machines to jobs. If your problem has hard rules that must all hold at once, you want a solver.\n\n## What to use instead\n\n**Your existing software.** Booking systems, rota apps and delivery platforms very often have a scheduling feature already. Check before installing anything.\n\n**A spreadsheet solver.** Both LibreOffice Calc and Excel ship with one, free, and it handles a small rota or an allocation problem well. Set up the cells, state the constraints, press solve.\n\n**OR-Tools**, released free and open source by Google, is a serious constraint solver with worked examples for staff rostering and vehicle routing. It needs a little Python, and \"a little\" is genuine: the rostering example is about eighty lines and is designed to be adapted.\n\n**Dedicated route planners.** For deliveries, tools starting free for a handful of stops. Routing well is a hard problem and worth not solving yourself.\n\n## Where the model earns its place\n\nThree real jobs, and they are not the scheduling.\n\n**Turning what is in your head into a written list of constraints.** Most owners have never written the rules down, and half the rules are unstated. *Interview me about how we build the rota. Ask one question at a time until you have a complete list of rules, and tell me where two of them conflict.* This is a good exercise and it frequently finds the contradiction that made the rota impossible.\n\n**Writing the solver code from the constraint list.** Given a clear list, generating an OR-Tools model is code generation, which it does reasonably. You then run it, and the solver, not the model, guarantees the answer.\n\n**Explaining the result.** \"No valid rota exists\" is unhelpful. \"There is no solution because Thursday needs two people and only Ana and Miguel are available, and they cannot be paired\" is actionable, and turning solver output into that sentence is language work.\n\n**Writing the awkward message** to the person who did not get the weekend they wanted.\n\n## The check that catches everything\n\nWhatever produced the rota, verify it with a rule that is not the thing that made it.\n\nA spreadsheet with one row per constraint and a formula returning TRUE or FALSE. Ana on a Tuesday? FALSE. Anyone over five days? FALSE. Every shift covered? TRUE.\n\nTen minutes to build, reusable every week, and it catches the failure whether it came from a model, a solver misconfigured, or a tired person at ten at night. The verification is cheap even where the solving is hard, which is true of most constraint problems and is the practical reason this check is always worth building.\n\n## When to stop\n\nIf your rota takes twenty minutes a week and works, leave it alone. This lesson is for the business where scheduling hurts: many staff, many rules, or routes that waste real fuel. Below that, a solver is a project you do not need.\n\n## Start by writing the rules down\n\nBefore any tool, get the constraints onto paper and mark each one **hard** or **soft**.\n\nHard rules cannot be broken: legal rest periods, the qualified person who must be on site, the two-person minimum. Soft rules are preferences: Ana would rather not work Mondays, people like alternating weekends.\n\nMost rota misery comes from treating a preference as a rule. Once separated, a problem that seemed impossible usually has several answers, and you can rank them by how many preferences they satisfy rather than searching for a perfect arrangement that does not exist.\n\nShow the list to whoever actually builds the rota now. They will add three rules nobody wrote down, and those three are usually the reason previous attempts to automate it failed.\n\n## What good looks like\n\nA rota you can defend. When somebody asks why they got two weekends in a row, you can point at the rules and show that no arrangement satisfying the hard constraints gave them anything else.\n\nThat is worth more than the time saved. Rota disputes in small teams are rarely about the hours; they are about the suspicion that the allocation was arbitrary. A written rule set and a check that everybody can read removes the suspicion, whichever tool produced the schedule."},"check":{"question":"A restaurant manager builds a rota with an AI assistant, then asks the same assistant to check it against the eight staffing rules. It reports that all eight are satisfied. Two are in fact broken. Why?","options":[{"text":"The rules were not restated in the checking request, so the assistant checked against a partial recollection of them from earlier in the conversation.","correct":false,"tempting":"Blames a context problem that would be fixed by pasting the rules again, when the same false confirmation appears with all eight rules stated afresh."},{"text":"Checking a rota means testing every shift against every constraint, which generating text does not do, so the confirmation was produced the same way the rota was.","correct":true},{"text":"The assistant is biased toward agreeing with content it produced itself, so an independent model would have caught the violations.","correct":false,"tempting":"Names a real self-preference tendency, but a second model generating a verdict rather than testing each rule fails in the same way for the same reason."},{"text":"Eight rules is beyond what can be verified in a single response, so the check should have been split into eight separate requests, one per rule, each returning a simple pass or fail verdict.","correct":false,"tempting":"Splitting genuinely helps and still leaves each verdict generated rather than computed, which is why the check belongs in a formula instead."}]},"prev":{"slug":"stock-and-suppliers","title":"Reorder points, and comparing quotes that are not comparable","url":"https://addaly.com/learn/ai-for-small-business/stock-and-suppliers"},"next":{"slug":"hiring-without-discriminating","title":"Hiring: where automation is most regulated","url":"https://addaly.com/learn/ai-for-small-business/hiring-without-discriminating"},"authorship":"Founder and series editor: Dr Mustafa Mun. Written by AI models to a written standard. Exam keys checked blind by a second model: 3,665 of 3,666 agreed. Academic review invited.","review":{"status":"Draft, open for academic review"},"cite":"Addaly (2026) 'Rotas and routes: the tools that actually solve them', in AI for a Small Business. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/ai-for-small-business/rotas-routes-and-solvers (Accessed: 13 October 2026).","licence":{"name":"CC BY-NC-SA 4.0","url":"https://creativecommons.org/licenses/by-nc-sa/4.0/"},"reader":{"schema":1,"title":"Rotas and routes: the tools that actually solve them","courseTitle":"AI for a Small Business","module":{"index":6,"slug":"money-and-the-back-office","title":"Money, paperwork and the back office"},"answer":null,"keyIdea":"Rotas, routes and allocation are constraint problems that need a solver, not a generator, so use a spreadsheet solver or OR-Tools for the answer, use the model to elicit the constraints and explain the result, and always verify with a separate rule-by-rule check.","hero":{"kind":"plate","image":null,"alt":null,"caption":null},"blocks":[{"t":"h2","id":"a-different-kind-of-problem","runs":[{"text":"A different kind of problem"}]},{"t":"p","runs":[{"text":"Everything else in this course is a language problem. A rota is not."}]},{"t":"p","runs":[{"text":"“Two people on every shift, Ana cannot work Tuesdays, nobody more than five days, Miguel and Sofia not paired, everyone gets one weekend off in three” is a "},{"text":"constraint satisfaction problem","b":true},{"text":". Solving it means searching through possible arrangements until one satisfies every rule: a procedure, run by a computer, that either finds a valid answer or proves there is not one."}]},{"t":"p","runs":[{"text":"A language model does not search. It writes a rota-shaped document, and rota-shaped is not the same as valid. Ask it to check its own work and it will confidently confirm the rota it just broke."}]},{"t":"p","runs":[{"text":"The same applies to delivery routes, packing a van, fitting appointments around travel time, and allocating machines to jobs. If your problem has hard rules that must all hold at once, you want a solver."}]},{"t":"h2","id":"what-to-use-instead","runs":[{"text":"What to use instead"}]},{"t":"p","runs":[{"text":"Your existing software.","b":true},{"text":" Booking systems, rota apps and delivery platforms very often have a scheduling feature already. Check before installing anything."}]},{"t":"p","runs":[{"text":"A spreadsheet solver.","b":true},{"text":" Both LibreOffice Calc and Excel ship with one, free, and it handles a small rota or an allocation problem well. Set up the cells, state the constraints, press solve."}]},{"t":"p","runs":[{"text":"OR-Tools","b":true},{"text":", released free and open source by Google, is a serious constraint solver with worked examples for staff rostering and vehicle routing. It needs a little Python, and “a little” is genuine: the rostering example is about eighty lines and is designed to be adapted."}]},{"t":"p","runs":[{"text":"Dedicated route planners.","b":true},{"text":" For deliveries, tools starting free for a handful of stops. Routing well is a hard problem and worth not solving yourself."}]},{"t":"h2","id":"where-the-model-earns-its-place","runs":[{"text":"Where the model earns its place"}]},{"t":"p","runs":[{"text":"Three real jobs, and they are not the scheduling."}]},{"t":"p","runs":[{"text":"Turning what is in your head into a written list of constraints.","b":true},{"text":" Most owners have never written the rules down, and half the rules are unstated. "},{"text":"Interview me about how we build the rota. Ask one question at a time until you have a complete list of rules, and tell me where two of them conflict.","i":true},{"text":" This is a good exercise and it frequently finds the contradiction that made the rota impossible."}]},{"t":"p","runs":[{"text":"Writing the solver code from the constraint list.","b":true},{"text":" Given a clear list, generating an OR-Tools model is code generation, which it does reasonably. You then run it, and the solver, not the model, guarantees the answer."}]},{"t":"p","runs":[{"text":"Explaining the result.","b":true},{"text":" “No valid rota exists” is unhelpful. “There is no solution because Thursday needs two people and only Ana and Miguel are available, and they cannot be paired” is actionable, and turning solver output into that sentence is language work."}]},{"t":"p","runs":[{"text":"Writing the awkward message","b":true},{"text":" to the person who did not get the weekend they wanted."}]},{"t":"h2","id":"the-check-that-catches-everything","runs":[{"text":"The check that catches everything"}]},{"t":"p","runs":[{"text":"Whatever produced the rota, verify it with a rule that is not the thing that made it."}]},{"t":"p","runs":[{"text":"A spreadsheet with one row per constraint and a formula returning TRUE or FALSE. Ana on a Tuesday? FALSE. Anyone over five days? FALSE. Every shift covered? TRUE."}]},{"t":"p","runs":[{"text":"Ten minutes to build, reusable every week, and it catches the failure whether it came from a model, a solver misconfigured, or a tired person at ten at night. The verification is cheap even where the solving is hard, which is true of most constraint problems and is the practical reason this check is always worth building."}]},{"t":"h2","id":"when-to-stop","runs":[{"text":"When to stop"}]},{"t":"p","runs":[{"text":"If your rota takes twenty minutes a week and works, leave it alone. This lesson is for the business where scheduling hurts: many staff, many rules, or routes that waste real fuel. Below that, a solver is a project you do not need."}]},{"t":"h2","id":"start-by-writing-the-rules-down","runs":[{"text":"Start by writing the rules down"}]},{"t":"p","runs":[{"text":"Before any tool, get the constraints onto paper and mark each one "},{"text":"hard","b":true},{"text":" or "},{"text":"soft","b":true},{"text":"."}]},{"t":"p","runs":[{"text":"Hard rules cannot be broken: legal rest periods, the qualified person who must be on site, the two-person minimum. Soft rules are preferences: Ana would rather not work Mondays, people like alternating weekends."}]},{"t":"p","runs":[{"text":"Most rota misery comes from treating a preference as a rule. Once separated, a problem that seemed impossible usually has several answers, and you can rank them by how many preferences they satisfy rather than searching for a perfect arrangement that does not exist."}]},{"t":"p","runs":[{"text":"Show the list to whoever actually builds the rota now. They will add three rules nobody wrote down, and those three are usually the reason previous attempts to automate it failed."}]},{"t":"h2","id":"what-good-looks-like","runs":[{"text":"What good looks like"}]},{"t":"p","runs":[{"text":"A rota you can defend. When somebody asks why they got two weekends in a row, you can point at the rules and show that no arrangement satisfying the hard constraints gave them anything else."}]},{"t":"p","runs":[{"text":"That is worth more than the time saved. Rota disputes in small teams are rarely about the hours; they are about the suspicion that the allocation was arbitrary. A written rule set and a check that everybody can read removes the suspicion, whichever tool produced the schedule."}]}],"check":{"question":[{"text":"A restaurant manager builds a rota with an AI assistant, then asks the same assistant to check it against the eight staffing rules. It reports that all eight are satisfied. Two are in fact broken. Why?"}],"options":[{"text":[{"text":"The rules were not restated in the checking request, so the assistant checked against a partial recollection of them from earlier in the conversation."}],"correct":false,"tempting":[{"text":"Blames a context problem that would be fixed by pasting the rules again, when the same false confirmation appears with all eight rules stated afresh."}]},{"text":[{"text":"Checking a rota means testing every shift against every constraint, which generating text does not do, so the confirmation was produced the same way the rota was."}],"correct":true,"tempting":null},{"text":[{"text":"The assistant is biased toward agreeing with content it produced itself, so an independent model would have caught the violations."}],"correct":false,"tempting":[{"text":"Names a real self-preference tendency, but a second model generating a verdict rather than testing each rule fails in the same way for the same reason."}]},{"text":[{"text":"Eight rules is beyond what can be verified in a single response, so the check should have been split into eight separate requests, one per rule, each returning a simple pass or fail verdict."}],"correct":false,"tempting":[{"text":"Splitting genuinely helps and still leaves each verdict generated rather than computed, which is why the check belongs in a formula instead."}]}],"order":[2,0,3,1],"why":null},"prev":{"slug":"stock-and-suppliers","title":"Reorder points, and comparing quotes that are not comparable","minutes":9},"next":{"slug":"hiring-without-discriminating","title":"Hiring: where automation is most regulated","minutes":10}}}