TL;DR for operators
Hospital bed allocation is not just “find an empty bed.” It is a rolling constraint problem: patients arrive, diagnoses imply treatment trajectories, treatment phases require different levels of care, rooms have different capacities and monitoring categories, some patients cannot share rooms, hospital policy may forbid mixed-gender rooms, and moving patients unnecessarily is bad practice. Yes, the spreadsheet is sweating.
BedreFlyt is a proof-of-concept digital twin that formalises this problem. It combines a knowledge base, an ABS simulation model, SMOL orchestration, and the Z3 SMT solver to generate day-by-day bed bay allocation plans for a hospital ward.1
The paper does not show a deployed AI hospital optimizer. It shows that a modular formal-methods architecture can take realistic patient-flow data, simulate treatment-driven bed needs, encode ward constraints, and compute feasible allocation plans when such plans exist.
The business implication is practical but bounded. A system like this could reduce nurse-heavy manual placement work, minimise avoidable patient moves, help managers test ward-capacity buffers, and support seasonal or emergency what-if planning. The paper does not yet prove ROI, workflow adoption, clinical outcome improvement, or live integration with hospital systems.
The most useful way to read the paper is mechanism-first: patient arrivals become treatment trajectories; treatment trajectories become resource needs; resource needs become constraint problems; solved constraints become allocation plans; infeasible cases expose operational limits. That chain is where the value sits.
Bed allocation is a constraint problem disguised as admin
The hospital ward problem in BedreFlyt starts with a familiar operational headache: a patient arrives and needs a bed. In a calm spreadsheet universe, this is a row with a vacancy. In a real ward, it is a small negotiation with physics, policy, staffing, infection control, gender rules, care intensity, and tomorrow morning’s arrivals.
The paper focuses on bed bays, meaning designated slots inside ward rooms where rolling beds can be placed. Rooms differ in capacity and care category. Some are more suitable for patients who need closer monitoring. Some patients are contagious and need isolation. Patients sharing a room must satisfy ward policy constraints, including gender compatibility in the use case studied. Patients also move through treatment phases, so their care requirements may change over a multi-day stay.
That last detail matters. A good allocation for Monday may become poor on Wednesday. But “optimal” reallocation every time a patient’s needs change would be absurd if it means constantly moving patients around. So BedreFlyt is solving two problems at once:
- place every patient in a suitable room, if a suitable placement exists;
- minimise unnecessary reallocations across days.
This is why the paper is more interesting than another “AI in healthcare” brochure. It does not begin with a model looking for a use case. It begins with an operational process that already has rules, exceptions, and consequences.
The digital twin is not a 3D hospital dollhouse
The phrase “digital twin” still invites a misleading mental image: a glossy virtual replica of a hospital, perhaps with blinking beds and dashboards that look expensive in procurement meetings. BedreFlyt is not that.
Its twin is closer to a model-management infrastructure. The system keeps formal knowledge about the ward, simulates patient-flow scenarios, and generates constraint-solving tasks. The useful representation is not visual realism; it is operational fidelity.
The architecture has five essential parts:
| Component | What it does | Operational consequence |
|---|---|---|
| Knowledge base / ontology | Encodes rooms, bed capacities, care categories, treatments, tasks, and task dependencies | Ward knowledge is configurable rather than hard-coded into one brittle script |
| SMOL application | Orchestrates components and connects runtime state with knowledge-graph queries | The twin can configure models from formalised domain knowledge |
| Local data store | Holds patient streams and ward data for the prototype | Historical scenarios can be replayed before live integration exists |
| ABS simulation model | Turns incoming patients and treatment trajectories into time-indexed bed needs | Patient flow becomes a sequence of allocation problems |
| Z3 SMT solver | Checks whether constraints can be satisfied and returns room assignments | Allocation becomes explicit, auditable, and failure-aware |
The important design choice is separation. Domain knowledge lives in the ontology. Patient-flow dynamics live in the simulation. Allocation feasibility lives in the solver. Orchestration lives in SMOL.
That makes BedreFlyt more like an operational reasoning pipeline than a single monolithic “AI model.” Less glamorous, more useful. Terrible news for slideware, excellent news for maintainability.
Patient streams become treatment trajectories
The paper’s mechanism begins with a stream of patients. Each patient has an arrival time, an identifier, gender, potential contagiousness, and an associated diagnosis or treatment. The diagnosis maps to a patient trajectory: a sequence of tasks such as pre-surgery, surgery, and post-surgery recovery.
Each task has two operational properties:
- an average duration;
- a required bed bay category.
The ABS simulation model tracks these treatment packages over time. At each time interval, it checks for new arrivals, updates ongoing treatment tasks, records active bed needs, and collects the current resource requirements for each patient. The result is a timeline of bed requirements, not a static list of patients.
That distinction is the heart of the architecture. Bed allocation is not solved once. It is repeatedly reformulated as patient needs evolve.
In the current prototype, the time interval is day-level. The authors note that finer granularity, such as minutes or variable update intervals, would be needed for a more realistic online twin. For now, the model is deliberately coarse enough to demonstrate architecture and feasibility without pretending it has already absorbed the messiness of live ward operations.
Treatment needs become solver constraints
Once the simulation has generated bed needs for a given day, the solver receives an allocation problem.
The paper formulates this as a satisfiability modulo theories problem. In plain operational terms, Z3 is asked: can these patients be assigned to these rooms while satisfying the rules?
The constraints include:
- each patient must be assigned to exactly one room;
- room capacity cannot be exceeded;
- patients sharing a room must satisfy the gender policy;
- contagious patients must be isolated;
- patients must be placed in rooms with suitable care categories;
- reallocations should be minimised relative to the previous valid assignment.
The elegance here is not that the constraints are exotic. They are almost painfully ordinary. That is exactly the point. Hospital operations often fail not because the rules are unknowable, but because the rule interactions become too costly for humans to recompute continuously under time pressure.
BedreFlyt turns those interactions into a formal allocation problem. If a solution exists, the solver can return one. If no solution exists, the system has learned something operationally important: the ward state is infeasible under the encoded assumptions.
This is where formal methods are useful. Not because they make healthcare tidy, but because they make the untidiness explicit.
The main evidence shows feasibility, not deployment success
The evaluation has two layers, and they should not be confused.
| Evaluation element | Likely purpose | What it supports | What it does not prove |
|---|---|---|---|
| Realistic hospital scenario using anonymised historical ward data | Main proof-of-concept evidence | The architecture can process realistic patient streams and produce day-by-day allocation plans | That the system works in live clinical workflow |
| Synthetic scaling from 100 to 2000 patients and 30 to 365 days | Scalability and stress testing | The architecture remains computationally feasible across larger planning scenarios | That real hospitals would face these exact distributions |
| Visual ward allocation example | Implementation illustration | The solver can output concrete room assignments for a given day | That the allocation is clinically preferred by staff |
| Infeasible high-stress cases | Boundary exploration | The system can reveal when encoded constraints cannot be satisfied | That the current mitigation logic is adequate for real operations |
For the realistic scenario, the authors use anonymised historical data from a major Norwegian healthcare provider. A typical case with 100 patients over 30 days is computed in approximately 30 seconds. The computations were run on an M2 Pro MacBook Pro with 32 GB of RAM, using Docker for the component composition.
For scalability, the authors vary the number of patients from 100 to 2000 and the planning horizon from 30 to 365 days. Nearly all scenarios are computed in under 20 minutes. The exception is the 2000-patient, 30-day case, which takes 80 minutes. The paper explains that this high-density scenario increases the time required to construct the constraint model, even when unsatisfiability should be relatively easy for the solver to establish.
This is a useful result, but it should be read carefully. The evidence says: under the paper’s modelling choices, a modular digital twin can produce allocation plans at operationally plausible compute times. It does not say: hospitals can now plug this in and fire up autonomous bed planning by Monday.
Monday is always where the brochure goes to die.
The odd 2000-patient result is a clue about operational density
The most interesting scaling detail is not simply that larger scenarios take longer. That would be a discovery only to people who have never opened a laptop.
The interesting bit is the spike: 2000 patients over 30 days takes much longer than most other tested combinations. A year-long horizon with distributed load can be easier than a short horizon with extreme daily density, because the constraint model must represent many simultaneous placement interactions.
For operators, this matters because resource planning risk is rarely about annual totals alone. A hospital may handle a high yearly patient count while still being vulnerable to short bursts: seasonal fractures, infection waves, surgery backlogs, emergency inflows, or staffing shortages. BedreFlyt’s architecture is therefore not just a capacity calculator. It is a way to test whether particular demand shapes break the allocation logic.
The paper’s current handling of infeasible days is intentionally limited: in stress scenarios where no feasible allocation exists, the day is skipped, the previous bed allocation remains unchanged, and the simulation proceeds. The authors are clear that a real hospital would need more refined mitigation actions outside the current prototype.
That limitation is not a footnote. It is a product requirement. In the real world, infeasibility cannot merely be logged. It must trigger escalation: overflow rules, transfers, staffing changes, delayed procedures, temporary room reclassification, or administrative intervention.
The business value is decision support, not autonomous hospital control
The safest business interpretation is also the strongest: BedreFlyt points toward constraint-aware operational decision support.
The immediate user is not a CEO admiring a digital twin strategy deck. The user is closer to an admitting nurse, ward manager, or operations planner who needs to answer concrete questions:
- Where can this patient go today?
- Which patients would need to move if new admissions arrive tomorrow?
- How much buffer should be preserved for emergency patients?
- Which room-category distribution becomes fragile under seasonal pressure?
- What happens if one room is temporarily unavailable?
- Which constraints make the plan infeasible?
The paper’s architecture supports both short-term and long-term uses. Short-term, it can generate room allocations for incoming patients. Long-term, it can run what-if scenarios across different patient inflows, seasonal assumptions, risk levels, and ward configurations.
Cognaptus inference: the ROI pathway would likely begin with reduced coordination burden, fewer avoidable reallocations, better visibility into capacity stress, and faster scenario testing. The measurable business case would need to track staff time, allocation delays, patient moves, occupancy quality, escalation frequency, and downstream bottlenecks.
The paper does not measure those outcomes. It creates a technically plausible route to measuring them.
Why the ontology matters more than it first appears
The ontology can sound like plumbing. In this paper, it is closer to the control panel.
By encoding rooms, bed capacities, care categories, treatment tasks, task dependencies, and patient trajectories in a knowledge base, BedreFlyt avoids hard-coding ward assumptions directly into the simulator or solver. That matters because hospitals change. Rooms go out of service. Monitoring capacity changes. Treatment pathways evolve. New resource categories become relevant. Equipment, diagnostics, and staff scheduling may need to be added later.
A hard-coded optimiser can work beautifully until the real ward changes, which is to say, until lunch.
The knowledge-base layer gives the architecture a path to configurability. It also creates a governance challenge. Someone must maintain the ontology, validate assumptions, update treatment durations, encode local policy correctly, and ensure that the model reflects operational reality rather than last quarter’s process diagram.
That is not a defect. It is the price of making implicit operational knowledge explicit.
The paper’s contribution is architectural integration
None of the individual ingredients is new in isolation. Hospitals have used simulation. Digital twins exist in healthcare. Knowledge graphs are a known representation method. SMT solvers are established formal-methods tools. ABS and SMOL come from prior modelling and digital-twin research.
The contribution is the integration:
Patient stream
↓
Treatment trajectory simulation
↓
Time-indexed bed needs
↓
Constraint formulation
↓
Z3 allocation solution
↓
Day-by-day room assignment stream
The system is valuable because the pieces divide the problem cleanly. Simulation handles time and treatment progression. The ontology handles domain meaning. The solver handles feasibility and optimisation. SMOL handles orchestration and model configuration.
This is also why the paper should not be read as “AI predicts hospital beds.” That framing is too soft. BedreFlyt is better understood as a formal pipeline for converting operational knowledge and patient-flow data into allocation decisions.
The distinction matters for implementation. Predictive dashboards often stop at “demand may rise.” BedreFlyt-style systems can go further: “given this demand, these rooms, these policies, and these patient requirements, here is a feasible allocation—or here is where feasibility fails.”
What has to happen before this becomes hospital software
The paper is disciplined about future work, and the boundaries are material.
First, the current prototype uses historical data and does not yet integrate live ward systems. The authors explicitly defer the legal and integration challenges of going online. That means data governance, privacy, system interoperability, auditability, and workflow responsibility remain open.
Second, the current simulation uses day-level granularity and average task durations. Real wards operate at variable intervals. Admissions happen within days, discharges slip, tests are delayed, staff availability changes, and patients do not politely follow mean durations because the model has a publication deadline.
Third, the current constraint set is intentionally small. It covers room capacity, gender policy, contagiousness, and bed bay category. Practical deployment would need richer constraints: patient age, comorbidity, equipment availability, diagnostics, staff rosters, procedure schedules, transfers between wards, and local clinical preferences.
Fourth, the current system handles infeasibility in a research-friendly way. Real deployment would need escalation logic. If the solver cannot find a feasible allocation, the product must help users decide what operational lever to pull next.
Fifth, adoption depends on trust. A dashboard that suggests bed moves must be legible to staff. It should show why a recommendation exists, which constraints bind, and what alternatives are available. Otherwise it becomes another system that generates technically correct answers no one wants to own.
BedreFlyt’s real lesson for enterprise AI
The broader enterprise lesson is not “digital twins are coming for hospitals.” They have been “coming” for years, wearing various conference badges.
The better lesson is that some operational problems are poorly served by generic AI because they require exact constraint handling, explicit domain knowledge, and repeatable decision logic. Bed allocation is one of those problems. So are many enterprise workflows: logistics routing, maintenance scheduling, staff rostering, production planning, claims triage, and resource dispatch.
In these cases, the AI story is not a chatbot sitting on top of a database. It is a structured pipeline that turns messy events into formal decisions, while keeping enough domain semantics for the system to be maintained.
BedreFlyt is a useful example because it does not pretend that intelligence is one thing. It separates knowledge representation, simulation, orchestration, and solving. That is often how practical autonomy arrives: not as one brilliant model, but as several boring components forced to cooperate.
Boring components cooperating is, admittedly, also a decent description of most functioning organisations.
Final diagnosis: a useful prototype, not a hospital autopilot
BedreFlyt reimagines hospital resource planning by treating bed allocation as a dynamic, constraint-aware planning problem. Its strongest contribution is not a single benchmark number, but a mechanism: use formalised ward knowledge to configure simulations, use simulations to generate time-indexed resource needs, and use constraint solving to produce allocation plans while minimising unnecessary patient movement.
The evidence is promising within scope. The architecture works on anonymised historical ward data and scales across synthetic scenarios up to 2000 patients and year-long planning horizons, with one notable high-density stress case taking substantially longer. That supports feasibility, not deployment maturity.
For hospital operators, the practical value is decision support: less manual allocation burden, earlier visibility into infeasible conditions, and better capacity scenario planning. For technology leaders, the lesson is architectural: in high-stakes operations, the useful twin is not the prettiest replica. It is the one that can turn changing reality into constrained choices fast enough to matter.
The next test is not whether BedreFlyt can produce another allocation plan. It is whether a live ward can use such plans without adding a new layer of operational theatre. Healthcare already has enough theatre. Most of it comes with paperwork.
Cognaptus: Automate the Present, Incubate the Future.
-
Riccardo Sieve, Paul Kobialka, Laura Slaughter, Rudolf Schlatte, Einar Broch Johnsen, and Silvia Lizeth Tapia Tarifa, “BedreFlyt: Improving Patient Flows through Hospital Wards with Digital Twins,” arXiv:2505.06287, 2025. https://arxiv.org/pdf/2505.06287 ↩︎