You’re given the following map the place many flags are proven on their corresponding international locations.
Assemble a forest of maximal weight such that:
- There exist at most one edge between two flags if and provided that the related international locations share no less than one border. As an example, France and Belgium could possibly be linked. Island have to be a single node tree as a result of it doesn’t share any border.
- The load of any edge is the sum of the variety of colours on the 2 flags. France’s flag has 3 colours and Belgium’s flag additionally has 3 colours, which signifies that linking France to Belgium will weight 6 within the goal.
That can assist you extra: Portugal has 6 colours on its flag and Spain 2, you will need to hyperlink the 2 international locations in a maximal resolution and the related edge will weight 6+2=8 within the goal!
That can assist you much more
As a place to begin and for instance the necessities right here is an clearly non-optimal resolution of worth 115. You’ll be able to optimize it in GeoGebra right here.
European Nations and Variety of Completely different Colours in Their Flags (please discard any pointless incidence or add one if obligatory)
- Albania – 2 colours (pink, black)
- Andorra – 4 colours (blue, yellow, pink, white)
- Armenia – 3 colours (pink, blue, orange)
- Austria – 2 colours (pink, white)
- Azerbaijan – 4 colours (blue, pink, inexperienced, white)
- Belarus – 4 colours (pink, inexperienced, white, pink sample)
- Belgium – 3 colours (black, yellow, pink)
- Bosnia and Herzegovina – 3 colours (blue, yellow, white)
- Bulgaria – 3 colours (white, inexperienced, pink)
- Croatia – 5 colours (pink, white, blue, black, yellow)
- Cyprus – 3 colours (white, copper-orange, inexperienced)
- Czech Republic – 3 colours (white, pink, blue)
- Denmark – 2 colours (pink, white)
- Estonia – 3 colours (blue, black, white)
- Finland – 2 colours (white, blue)
- France – 3 colours (blue, white, pink)
- Georgia – 2 colours (white, pink)
- Germany – 3 colours (black, pink, yellow)
- Greece – 2 colours (blue, white)
- Hungary – 3 colours (pink, white, inexperienced)
- Iceland – 3 colours (blue, white, pink)
- Eire – 3 colours (inexperienced, white, orange)
- Italy – 3 colours (inexperienced, white, pink)
- Kazakhstan (partly in Europe) – 2 colours (sky blue, gold)
- Kosovo – 3 colours (blue, yellow, white)
- Latvia – 2 colours (pink, white)
- Liechtenstein – 3 colours (blue, pink, yellow)
- Lithuania – 3 colours (yellow, inexperienced, pink)
- Luxembourg – 3 colours (pink, white, mild blue)
- Malta – 3 colours (white, pink, grey/silver for cross)
- Moldova – 4 colours (blue, yellow, pink, brown/gold for emblem)
- Monaco – 2 colours (pink, white)
- Montenegro – 4 colours (pink, gold/yellow, blue, white)
- Netherlands – 3 colours (pink, white, blue)
- North Macedonia – 2 colours (pink, yellow)
- Norway – 3 colours (pink, white, blue)
- Poland – 2 colours (white, pink)
- Portugal – 4 colours (inexperienced, pink, yellow, white)
- Romania – 3 colours (blue, yellow, pink)
- Russia – 3 colours (white, blue, pink)
- San Marino – 3 colours (white, mild blue, yellow/gold)
- Serbia – 4 colours (pink, blue, white, yellow/gold)
- Slovakia – 4 colours (white, blue, pink, yellow)
- Slovenia – 4 colours (white, blue, pink, yellow)
- Spain – 3 colours (pink, yellow, white)
- Sweden – 2 colours (blue, yellow)
- Switzerland – 2 colours (pink, white)
- Turkey – 2 colours (pink, white)
- Ukraine – 2 colours (blue, yellow)
- United Kingdom – 3 colours (pink, white, blue)
- Vatican Metropolis – 2 colours (yellow, white)