Optimal flow for emergency staff and patient traffic