In this repository, we show and explain which are the weights for the edges of the knowledge graph (KG) used in doi: TODO (DOI: TODO). Specifically, these weights are for the edges related to the spatial dimension of the domain represented with the KG. This KG was used as a basis for the work "Spatiotemporal Data Modelling for Epidemiological Research in Hospitals" 10.1109/JBHI.2024.3417224.
To be more specific, the spatial edges are those from a more recent version of the KG that can be found in the following repository: LorenaPujante/HospitalKG_Changes.
In addition, the calculation of the weights is also influenced by the process of our random hospital generator to create the hospital and Floor layouts. The values of the weights are based on the hospital layout, so it is important to consider the hospital generator's principles (creation and organization rules, limitations).
Here, we present a figure with the spatial dimension of the KG where each type of edge has its weight (in navy blue).
Below, we present some other related repositories that may be of interest to you:
- STeMECH: Code for
doi: TODO. - HospitalKG_changes: It is also linked to
doi: TODO. - HospitalGeneratorRDF_V2: It is also linked to
doi: TODO.
As the basis of the process to calculate the generic weight of each type of edge, we have the following facts:
- The weight of the edges represents metres.
- We start with the following measurements:
- The size of a Bed is: 1×2 metres
- The size of a general Room for hospitalisations is: 3×6.5 metres
- To measure the distance between the Locations, we have only used the General Rooms. These Rooms are on the upper floors of the hospital. The ground floor (where the emergency rooms, ICU rooms, operating theatres and X-ray rooms are located) will not be taken into account. This is because the layout and size of the rooms on the ground floor are different from those on the other floors.
A schematic representation of a general Room for hospitalisations can be seen in the following figure. The dimensions are in metres. All the Rooms on the upper floor will have this layout.
- 1.1. Bed →(nextTo) Bed
- 1.2. Bed →(opposite) Bed
- 1.3. Bed →(placedIn) Room
- 1.4. Room →(nextTo) Room
- 1.5. Room →(opposite) Room
- 1.6. Room →(placedIn) Corridor
- 1.7. Corridor →(nextTo) Corridor
- 1.8. Corridor →(placedIn) Area
- 1.9. Area →(nextTo) Area
- 1.10. Area →(placedIn) Floor
- 1.11. Floor →(placedIn) Building
- 1.12. LogicZone →(hasArea) Area
Two Beds that are next to each other in the same Room will have a separation of 1 metre. We will add two times half the width of a bed to this distance. That's because we assume that both patients are not on the nearest edges of each bed; they would be in the centre of the bed. This extra distance is also useful for rooms with more than two adjacent beds to avoid getting distances that are too small.
So the total distance will be: 1 + 2×0.5 = 2 metres.
In our hospital layout, there won't be general Rooms with more than two Beds or where the Beds are opposite. However, if there would be a Room with a Bed opposite another Bed, there would be a 1.5 metre-wide corridor between them. Similarly to the distance between two adjacent Beds, we will add a small distance to this separation.
So the total distance will be: 1.5 + 1 = 2.5 metres.
We will consider this weight as the distance you must traverse to get to a Bed from the Room door. That is the distance from the door to the end of the bed.
- Bed_1: 1.5 + 1 = 2.5 metres
- Bed_2: 1.5 + 1×3 = 4.5 metres
- Average of the distances: (2.5 + 4.5)/2 = 7/2 = 3.5 metres
This distance might not correctly represent the fact of having two Beds that are in the same Room but that are neither adjacent nor opposite each other.
Bed →(placedIn) Room ←(placedIn) Bed
: 35 + 3.5 = 7.5
However, we assume that there won't be Rooms with a layout different from the showed previously. In addition, if there were another kind of Room layout, the distance between Beds could be represented by traversing several nextTo and opposite edges. For example:
Bed →(nextTo) Bed →(nextTo) Bed
: 2 + 2 = 4 metresBed →(opposite) Bed →(nextTo) Bed
: 2 + 2.5 = 4.5 metres
In our hospital, Rooms are placed in a mirror arrangement. The following figure represents four contiguous Rooms with the distance between them in metres.
The average of the distances between the doors of two Rooms is:
((0.5 + 0.5 + 0.5) + (0.5 + 3.5 + 0.5)) / 2 = ((1.5) + (4.5)) / 2 = 6/2 = 3 metres (This is the width of a Room)
In our hospitals, between two opposing Rooms, there is a 2.5 metre-wide corridor so that two beds can pass through with some clearance. So, the weight of this edge will be 2.5 metres.
The distance between any two Rooms located in the same Corridor is based on the Weighted average of the maximum number of adjacent Rooms that can be in a Corridor.
To get this number of Corridors, we have executed several times our generator of random hospital layouts, HospitalGeneratorRDF_V2, with the params used in doi: TODO. After each execution, we have counted how many Areas have each area layout so we can know how many Corridors will be and how many adjacent Rooms are in each Corridor. The following table represents the results:
Weighted average:
(3×10 + 6×40 + 9×15 + 12×15 + 15×20)/100 = 885/100 = 8.85 ≈ 9 metres
However, this weight represents the distance of the path Room →(placedIn) Corridor ←(placedIn) Room
, so the weight of Room →(placedIn) Corridor
should be:
2α= 9 → α = 9/2 = 4.5 → Room →(placedIn) Corridor = 4.5 metres
Since the average distance between two Rooms in a Corridor is 9 metres, there will be adjacent Rooms that are nearer. When executing the shortest path algorithm in these cases, the result will be a concatenation of nextTo edges. For example:
Room →(nextTo) Room →(nextTo) Room
: 3 + 3 = 6 metresRoom →(nextTo) Room →(nextTo) Room →(nextTo) Room
: 3 + 3 + 3 = 9 metres
If the Weighted average distance between two Rooms in the same Corridor, the Weighted average distance between two Rooms in two neighbouring Corridors would be double. That is:
9×2 = 18 metres
However:
18 = Room → Corridor →(nextTo) Corridor ← Room
= 4.5 + α + 4.5 → 9 + α = 18 → α = 9
Corridor →(nextTo) Corridor
= 9 metres
Our hospital layouts have no Areas with Corridors that are not neighbours to any other Corridor of the Area.
Therefore, the average distance between any Room placed in an Area and any other Room of the same Area will be the same as the average distance between Rooms that are on neighbouring Corridors. That is, 18 metres.
However:
18 = Room → Corridor → Area ← Corridor ← Room
= 4.5 + 2α + 4.5 → 9 + 2α = 18 → α = 9/2 → α = 4.5
Corridor →(placedIn) Area
= 4.5 metres
Before explaining how we got the value for the weight of the Area →(nextTo) Area edge, we will show a figure. In this figure, we can see a schematic representation of the layout of a Floor. This Floor has 6 Areas organised in 2 rows and 4 columns. In our random hospital generator [TODO: CAMBIAR ENLACE AL NUEVO], the Area layout with the maximum number of Corridors has 4 Corridors arranged in a cross. The Areas in the image follow this layout. Corridors are painted in different colours according to the minimum number of Corridors we have to traverse from the origin corridor (it has a wider line in red) to each Corridor (we will call this number of corridors as number of jumps). The figure shows the different cases that we can find, depending on which is the origin corridor; the rest of the possible positions would coincide with any of those shown.
The distance between two adjacent Areas will be the average minimum number of jumps between a Corridor of one Area and a Corridor from another Area. So, this distance entirely depends on the layout of the Floor. In our case, the upper Floors of the hospital will have a layout with 2 rows and 4 columns, as in the previous figure. The number and disposition of the Corridors per Area may slightly change, but we will calculate the distance assuming the maximum number of Corridors in each Area.
To calculate the distance between adjacent areas, we will only take into consideration the corridors of the areas painted in pink in the figure.
The final result, in fact, represents the weight of this path:
22.5 = Corridor → Area →(nextTo) Area ← Corridor
= 4.5 + α + 4.5 → α = 22.5-9 → α = 13.5 → α = 4.5
Area →(nextTo) Area
= 13.5 metres
The weight between two non-adjacent Areas is calculated similarly to those Areas which are adjacent, that is, based on the number of Corridors. In this case, we will consider all the Corridors of the Floor except those from the origin Area.
As in the previous section, we will use as a basis the figure with the seven cases based on the 4×2 Floor layout.
The final result, in fact, represents the weight of this path:
39 = Corridor → Area → Floor ← Area ← Corridor
= 4.5 + 2α + 4.5 → 2α = 39-9 → α = 30/2 → α = 15
Area →(placedIn) Floor
= 15 metres
Going from a Floor to any other Floor of the same building is the same as the path showed in the next figure with the purple arrows. That is, traversing the origin Floor and then traversing the destination Floor, what can be traslated to going from a Corridor in one Floor to a Corridor of the other Floor.
We can calculte this distance in this way:
(Corridor → Area → Floor ← Area ← Corridor
)×2 = 39×2
Corridor → Area → Floor → Building ← Floor ← Area ← Corridor
= 78
4.5 + 15 + 2α + 15 + 4.5 = 78
2α = 78 - 39 = 39
α = 39/2 = 19.5
Floor →(placedIn) Building
= 19.5 metres
We want the distance between two Areas in the same LogicZone to be significantly lower than between two Areas from the same Floor. So we will divide the weight of Area →(placedIn) Floor edge by two.
(Corridor → Area → Floor ← Area ← Corridor
)×2 = 39×2
Corridor → Area → Floor → Building ← Floor ← Area ← Corridor
= 78
4.5 + 15 + 2α + 15 + 4.5 = 78
2α = 78 - 39 = 39
α = 39/2 = 19.5
LogicZone →(hasArea) Area
= 15/2 = 7.5 metres
We want a significant difference between two Patients that have been cared for by the same Service or Hospitalization unit and two Patients that didn't share healthcare workers (HCW).
So when two Patients shared the same group of HCW while they were in the Locations to compare, the distance between those Locations will be reduced:
- Service: → Distance = Spatial_Distance × 0.7
- Hospitalization Unit: → Distance = Spatial_Distance × 0.5
- As we read this README, we realise that the edge weights are not independent. They are designed to “measure” the distance from one Room to another Room based on the superior elements of the hierarchy that must be traversed (the distance between Beds is just an extra). Therefore, the weight of an edge between any two nodes X and Y does not represent the absolute distance between those node types, but it would be “the increase that must be added to the weight of the path in the current step to achieve the desired cost”.
In our work, we use the spatial dimension of the KG to get the distance between two Beds by a shortest path algorithm, so the weights of the edges are designed to match how this algorithm works. - Although the weight values may seem high, it should be noted that we will use a shortest path algorithm to calculate the distance between any two Beds. This algorithm searches for the path with the lowest cost, so it can find "shortcuts" by traversing several nextTo/opposite edges instead of placedIn edges (the most costly) when the Beds are placed in Rooms that are closer than the average distance for the Corridor, Area or Floor.
The following figure shows a section of a Floor, specifically 4 Areas, on which several paths have been defined between its Beds.
This schematic representation of a section of Floor 1 with its areas 0A, 1A, 2A and 0B shows the Corridors and Rooms of each Area and their ID. The Rooms shaded in light red have a bed used as the origin or destination of one path. A small brown rectangle has been placed in some of the Rooms. This rectangle symbolizes the door of the Room to indicate which Corridor the Room leads to. The rooms that face the same Corridor will be neighbours, and those that do not will not be.
The paths can be seen in the following table, where the total cost of the chosen path for every pair of Beds (Cost column) appears in black or indigo depending on whether it is an ordinary path (such as the proposed in this README for beds placed in the same Room, Corridor, Area, Floor or Building) or whether a “shortcut” with a concatenation of nextTo/opposite edges.
These shortcuts have a total distance around half the cost of the ordinary route.