EMBS 2024 Assessment Information

Packet Formats

Your solution will communicate with the server to request scenarios to solve. This is the format of the messages that you should send.

The server is at IP 192.168.10.1 on port 51100Remember to use your IP address.

Request

Send this to the server to request a scenario. 

Field Name

Width in bytes

Details

Message ID

1

0x01

Number of cities

1

Between 4 and 20 inclusive

Scenario ID

4

A big-endian 4 byte integer (see below) used to identify the scenario.

Request Response

The server will respond as follows:

Message ID

1

0x02

Number of cities

1

Set to whatever you requested.

Scenario ID

4

Set to whatever you requested.

Adjacency matrix

Number of cities ✕ Number of cities

See below.

The adjacency matrix is encoded as a list of unsigned bytes, encoding the distance between cities. A city is always 0 from itself and all distances are symmetric (distance(X,Y) == distance(Y,X)). If n is the number of cities, cities are numbered from 0 to n-1, and d(x,y) is the distance from city x to city y the list is:

d(0,0)

d(0,1)

d(0,2)

...

d(0,n-1)

d(1,0)

d(1,1)

d(1,2)

d(1,n-1)

d(2,0)

...

Solve

After solving the scenario, send this to the server to check your answer.

Message ID

1

0x03

Number of cities

1

Between 4 and 20 inclusive

Scenario ID

4

A big-endian 4 byte integer used to identify the scenario.

Shortest path

4

A big-endian 4 byte integer that is the length of the shortest path.

Solve Reply

Sent in response to Solve messages.

Message ID

1

0x04

Number of cities

1

Between 4 and 20 inclusive

ID

4

A big-endian 4 byte integer used to identify the scenario.

Answer

1

1 = Correct

2 = Incorrect

3 = Unknown

The server has only pre-calculated the answer for the first few scenarios, but it can generate any random set of cites from the four byte ID. If you try to check the answer of one of these other scenarios then Solve Reply will reply with value 3 - Unknown.

 

Example

An example scenario from the server is:

Size 4, ID 3:

[0 177 252 18] [177 0 73 250] [252 73 0 189] [ 18 250 189 0] Answer: 457

 

Endianness

If you can't remember endianness from first year, these diagrams show how big and little endian numbers are stored.

Images from Wikipedia.