Hello, if you have any need, please feel free to consult us, this is my wechat: wx91due
Assignment 4 (Due, Wednesday April-30-2025)
The objective of this assignment is to implement functions of
2) Finding a shortest path between two offices in the Towers, e.g. from room A125 to room B923.
Figure 1. The twin-tower of Xinghe in Shenzhen.
Node definitions
Node numbers for office room: Office rooms are numbering in a format of name of Tower (A/B) , followed by floor number (1-n), and then by room number (1-28). The first letter is the name of the Tower (A or B), while the last two digits are the room number(01-28), any number in between is the floor number(1-n). For example A120 is room Nr. 20 at the first floor of Tower A, or B10025 is room Nr. 25 at the 100 th floor of Tower B.
Node numbers for corridors: Nodes in corridors are defined in a similar format: name of Tower (A/B) followed by the letter C (for Corridors), then by floor number (1-n) and then the corridor node number (1-14) from left to right. For example AC1109, is the 9 th corridor node from left at the 11 th floor of A tower.
Node numbers for elevators: Nodes for both elevators are defined in a similar format: name of Tower (A/B) followed by the letter E (for Elevators), then by floornumber (1-n) and then elevator node number (1-2) from left to right. For example BE1101, is the elevator on the left side at the 11 th floor of B tower.
Figure 3. Floor planes for the 2 nd - n th floors. Node numbers are shown for 2 nd floor only. For other floors, please use the format mentioned above to define the node numbers.
Edge definitions
1) Nodes are connected as shown in Figures 2 and 3. It is an undirected graph, means all arcs are bidirectionally connected.
2) The weights for arcs connecting Tower A and B are 100. This is only for the two bi-directional arcs at the ground floor.
Submissions
start - is name of the starting point.
end - is the name of the end point. eWeights - is a 4xm matrix that contains the weights of the outward arcs for the elevator nodes for each floor. m is the number of floors. The first row of the matrix eWeights[0][n-1] contains the weights of the outwards arcs for the elevator AEn1, n is the floor number, while the second row of eWeights[1][n-1] is for AEn2, the third row of eWeights[2][n-1] is for BEn1, and eWeights[3][n-1] is for BEn2. The weights for elevator nodes might be very large at a particular floor of a particular elevator, so that it is possible to find the shortest path via e.g. the crossbeams.
The return value is the distance of the whole path (sum of all arcs in the path)
Hints: The input strings “start” and “end” includes the information about the floor numbers in each Tower. You should utilize it to create your graph.Submission:
Please submit: The source codes in a single file or one header file (*.h) + one source file (*.cpp). NO OTHER DOCUMENTS IS NEEDED.
Your score for this assignment is based on two parts: