# Partitioned Peace

Rules

Given a N*N grid of alternating colored houses, you have to come up with a minimum cost solution such that all red houses can reach other red houses without crossing a blue house and vice versa. To achieve this, you can do the following after selecting 2 houses:

- Build a new road between 2 houses (the road can be a bridge – i.e. it can go on top of other roads)
- Swap any 2 houses

Your score (cost) will be calculated as:

- Total Cost = Sum of all road costs + Number of swaps * Cost of 1 Swap
- Sum of each roads = Manhattan distance between the houses * Road Cost Multiplier

Changing any of the parameters resets the board

Information

N:

Max Roads:

Swap Cost:

Road Cost multiplier:

Current Cost (score):

0