# Enhancing Recognition Memory in Virtual Memory Palaces Using Worlds-in-Miniature
## Appendix A How to Implement a Virtual Memory Palace
### Procedural Generation of Memory Palaces
Rooms of the smallest size (\(1\times 1\)) had four walls, but only two were used for displaying images. Rooms with two units had six walls, allowing for three images, while rooms with three units had eight walls, allowing for four images. Images were randomly assigned and placed based on the number allocated to each room (see Figure 11). This system could accommodate an increased number of images depending on the number of rooms or memorization targets. This means that the system is not limited to the current experimental conditions and can be scaled up to larger environments or more complex structures as needed. For instance, more rooms and images can be added, or a more intricate spatial layout can be designed to adapt the system to various experimental purposes. However, for the experiment, we consistently fixed the number of allocated images to 30 in order to reduce the cognitive load on participants and keep the overall task manageable. ```
0:\(H,W\)\(\triangleright\) Height, Width of the map
0:\(RoomPlacingDataList\)\(\triangleright\) List of \((\text{u},\text{v})\) info for each room
1:\(TileMap\leftarrow\textsc{CreateTiles}(H,W)\)
2:Initialize(\(TileMap\),\"None\")
3:\(RoomList\leftarrow\emptyset\)\(\triangleright\) -- Build Rooms --
4:for\(i\gets 0\) to \(\textsc{Count}(RoomPlacingDataList)-1\)do
5:\((u,v)\gets RoomPlacingDataList[i]\)
6:\((x,y)\leftarrow\textsc{GetRandomPosition}(H,W)\)
7:\(room\leftarrow\textsc{CreateRoom}(x,y,u,v)\)
8:\(isIntersect\leftarrow\) False
9:forall\(r\) in \(RoomList\)do
10:if\(\textsc{Intersect}(room,r)\)then
11:\(isIntersect\leftarrow\) True
12:break
13:ifnot\(isIntersect\)then
14:\(\textsc{AddRoom}(RoomList,room)\)
15:for\(r\gets room.y\) to \(room.y+room.v-1\)do
16:for\(c\gets room.x\) to \(room.x+room.u-1\)do
17:\(TileMap[r][c]\leftarrow\) \"Room\"
18:\(RayList\leftarrow\emptyset\)
19:forall\(room_{1}\) in \(RoomList\)do
20:forall\(room_{2}\) in \(RoomList\)do
21:if\(room_{1}\
eq room_{2}\)then
22:\(ray\leftarrow\textsc{RayCast}(room_{1},room_{2})\)
23:\(\textsc{AddRay}(RayList,ray)\)
24:\(filteredRays\leftarrow\textsc{FilterWithoutRoomCollision}(RayList)\)
25:\(MST\leftarrow\textsc{GenerateMinimumSpanningTree}(filteredRays)\)
26:forall\(connection\) in \(MST\)do
27:\(ray\leftarrow\)\(connection.ray\)
28:forall\(tile\) in GetTilesAlongRay(TileMap, ray) do
29:if\(TileMap[tile.x][tile.y]=\) \"None\" then
30:\(TileMap[tile.x][tile.y]\leftarrow\) \"Path\"
```
1:\(edges\): List of edges \((Room_{1},Room_{2},Rays_{t}art,Ray_{e}nd)\)
2:\(mstEdges\): List of edges forming the MST
3:\(mstSet\leftarrow\emptyset\)\(\triangleright\) Set of rooms in the MST
4:\(mstEdges\leftarrow\emptyset\)\(\triangleright\) List of edges in the MST
5:if\(\textsc{Count}(edges)=0\)thenreturn\(mstEdges\)
6:Add\((mstSet,edges[0].Item1)\)\(\triangleright\) Add the first room to the MST
7:while\(\textsc{Count}(mstSet)<\textsc{Count}(rooms)\)do
8:\(minWeight\leftarrow\infty\)
9:\(minEdge\leftarrow\)null
10:for all\(edge\in\)edgesdo
11:if\(edge.Item1\in\)\(mstSet\)and\(edge.Item2\
otin\)\(mstSet\)then
12:\(weight\leftarrow\textsc{Distance}(edge.Item3,edge.Item4)\)
13:if\(weight<minWeight\)then
14:\(minWeight\gets weight\)
15:\(minEdge\gets edge\)
16:elseif\(edge.Item2\in\)\(mstSet\)and\(edge.Item1\
otin\)\(mstSet\)then
17:\(weight\leftarrow Distance(edge.Item4,edge.Item3)\)
18:if\(weight<minWeight\)then
19:\(minWeight\gets weight\)
20:\(minEdge\gets edge\)
21:if\(minEdge\
eq\)nullthen
22:\(\textsc{Add}(mstEdges,minEdge)\)
23:Add\((mstSet,minEdge.Item1)\)
24:endfor
25:return\(mstEdges\)
```

**Algorithm A2** Generate Minimum Spanning Tree (Prim's Algorithm)

### Interactive Manipulation of Worlds-in-Miniature

To enhance the effectiveness of the virtual memory palace, we introduced the WIM technique. WIM serves as a powerful tool that enables users to instantly grasp the spatial structure and effortlessly recognize their position and orientation, even in unfamiliar environments.