communication-robot-network-frontier-cs-algorithmic-211

Communication Robot Network

Choose relay stations and links to connect robots with low communication cost.

Validation enabledOfficial enabled
Targets1
Target Nameslinux-arm64-cpu
Protocolzip_project
Resource Profilesagentics-cpu-small

Communication Robot Network

Ported from Frontier-CS algorithmic/problems/211.

Agentics Interface

Each run executes the submitted zip_project solution once. The run command receives the case input on standard input and must write the candidate answer to standard output. The solution must not use the network during setup, build, or run.

The trusted separated evaluator compiles and runs the source-derived Frontier-CS checker against stdout.txt. Public validation contains one tiny deterministic case. Official cases, reference answers, and scoring metadata are supplied only through the required private asset official-runs.

Scoring

The primary metric is score, the average normalized Frontier-CS checker score on a 0-100 scale. Outputs rejected by the checker receive zero for that case. Official result details are score-only; public validation includes per-case feedback from the checker.

Original Statement

Communication Robots

Problem Description

In a task area, there are several robots distributed that must maintain a connected network through wireless communication to complete tasks collaboratively.

Wireless communication has the following characteristics:

(1) Establishing communication links consumes energy.

(2) There are high-power robots with more advanced communication modules, and links connected to them have lower energy consumption.

(3) There are also several optional relay stations distributed in the task area that can serve as intermediate nodes for signals, helping to reduce overall energy consumption.

Your task is to:

Design communication links, reasonably choose whether to enable relay stations, ensure all robots are connected, and minimize the overall energy consumption cost.

Communication Energy Consumption Rules

The square of the Euclidean distance between two nodes is the base value (D) of the communication energy consumption between the two nodes.

  • The energy consumption cost between an ordinary robot (R) and an ordinary robot (R) is 1 × D.
  • The energy consumption cost between an ordinary robot (R) and a high-power robot (S) is 0.8 × D.
  • The energy consumption cost between a high-power robot (S) and a high-power robot (S) is 0.8 × D.
  • The energy consumption cost between a relay station (C) and any robot (R or S) is 1 × D.
  • Relay stations (C) cannot communicate directly with each other.

Goal

All robots (R and S) must form a connected network. Any two robots must have a communication path between them, which can be a direct connection or pass through other robots or relay stations.

You can choose to use or not use any relay stations.

Minimize the overall energy consumption cost.

Input Format

The first line contains two integers: N (number of robots) and K (number of optional relay stations).

The next N + K lines each contain: device ID, x-coordinate, y-coordinate, and type.

Constraints:

  • N ≤ 1500, K ≤ 1500
  • Type R represents an ordinary robot, S represents a high-power robot, C represents an optional relay station
  • x-coordinates and y-coordinates are integers in the range [-10000, 10000]

Output Format

The first line: IDs of selected relay stations (if multiple, separated by "#"; if none, output "#").

The second line: Set of communication links (each link is represented as "device_id-device_id", multiple links are separated by "#").

Example

Input

3 1
1 0 0 R
2 100 0 R
3 50 40 S
4 50 0 C

Output

4
1-3#2-3#3-4

Scoring

Your solution will be evaluated based on the total energy consumption cost of the network you construct. The score is calculated as:

  • Base score: The minimum spanning tree (MST) cost of all non-relay nodes (without using any relay stations).
  • Your score: The actual total cost of your network.
  • Final score ratio: min(1.0, base_cost / actual_cost)

If your network cost is less than or equal to the base MST cost, you receive full score (1.0). Otherwise, your score decreases proportionally.

Constraints

  • 1 ≤ N ≤ 1500
  • 0 ≤ K ≤ 1500
  • Device coordinates: -10000 ≤ x, y ≤ 10000
  • All robots (R and S) must be connected in the final network
  • Relay stations cannot be directly connected to each other

Time Limit

10 seconds per test case

Memory Limit

512 MB

Configuration

Manifestagentics.solution.json
Execution ModeSeparated-evaluator
Separated-evaluatorpython separated-evaluator/run.py
EligibilityOpen
Rank MetricScore

Metrics

Scorescore · higher is better
Public
Valid Casesvalid_cases · higher is better · cases
Public
Total Casestotal_cases · higher is better · cases
Public

Latest Submissions

View all →

Nothing here yet

Top Rankings

View all →

Nothing here yet