## Introduction

One of my distractions for the past couple of years has been playing Series of Tubes. This is a networking puzzle gadget by Wei-Hwa Huang that can be be added to a Google personalised home page.

Series of Tubes can also be played at

http://weihwa-puzzles.appspot.com/gadgetpage?g=series_of_tubes.

## The Pieces – head, cross, tee, elbow & straight

The Series of Tubes game board consists of a number of squares in which there are tubes [, , & , ] and heads []. There are four types of tube – a cross [] which connects to the four adjacent squares, a tee [] which connects to three adacent squares, a straight [] and an elbow [] which both connect to two adacent squares.

## Make all the users happy!

At the start the pieces are in random positions and one (tube or head) is coloured green.

Any piece that is rotated so that it is connected to a green piece also turns green.

The object of the game is to “Make all the users happy!” That is to rotate pieces until there is a pathway between all tubes and they all turn green.

## Options – wrapping, size, marking yellow

Series of Tubes also has a number of additional options or features.

By default the pieces at the edge of the board only connect to adjacent pieces. For example any straight piece at the edge of the board has to run along that edge (as in the completed puzzle above). However there are options that allow for games in which the top edge of pieces at the top of the board can join to the bottom edges of pieces at the bottom of the board, and similarly for left and right edges. This is called wrapping.

The size of the board can also be altered. My current favourite is a 25 by 25 board with wrapping on both top-bottom and left-right.

As an aid to solving the puzzle, the background of individual pieces can be turned yellow.

## Strategies

While my current favourite game is 25 by 25 with wrapping, I’ll illustrate strategies on a 10 by 10 game with wrapping.

### Identify “fixed” pieces

There are four situations in which the correct orientation of pieces can be determined without reference to the orientation of any other piece.

#### Crosses are fixed

Crosses can not be rotatated, so their orientation is fixed.

#### Straights perpendicular to two heads

All pieces must be joined to all other pieces, so an arrangement of pieces consisting of one or more straight pices with a head at each end is invalid. Consequently if there are two heads with only (one or more) straight pices between them, then all of those straight pieces must be perpendicular to to the line joining the two heads.

#### Head with heads on 3 sides

The rotation of any head that is surrounded on three sides by other heads is fixed.

#### Combination heads & straights

The fourth case is a combination of the second and third cases. The rotation of a head is also fixed if it is surround on three sides by heads or by straights that are fixed because they are between the head in question and another head.

### Rotate adjacent pieces

Once pieces who’s orientation is fixed purely due to their nature or location on the board has been determined, it is possible to determine the orientation of some adjacent pieces.

#### Straights adjacent to fixed pieces

The orientation of any straight adjacent to a fixed piece can be determined. It is either:

- parallel to the fixed piece if that piece has no opening adjacent to the straight, or
- perpendicular to the fixed piece if the fixed piece has an opening adjacent to the straight.

#### Adjacent fixed pieces with matching number of openings

If the fixed pieces adjacent to a piece have the same total number of openings on their adjacent sides as that piece has, then the orientation of that piece can be fixed. That is the orientation of:

- a head adjacent to a fixed opening;
- an elbow (or straight, if not already fixed by application of the previous strategy) adjacent to two fixed openings; or
- a tee adjacent to three fixed openings

can be fixed.

#### Semi fixed elbows

The orientation of an elbow adjacent to one fixed opening is semi-fixed in that it can not have an opening opposite the fixed opening. Consequently any strategies that require no opening can be applied to the piece on the opposite side to the fixed opening. Equally any tee adjacent to wall (a fixed piece with no opening) is semi-fixed in that it must have an opening opposite the wall. Consequently any strategires that require an opening can be applied to pieces on the opposite side to the wall. This strategy can also be applied to a chain of adjacent elbows.

#### Tee with back to wall

Any tee adjacent to a wall, that is a fixed piece with no opening facing the tee must face away from that fixed piece.

#### Fixed elbows

Any elbow that is in a corner between two fixed pieces can be fixed. It will either be between:

- two openings, in which case it will face the two openings; or
- two walls, in which case it will face away from the two walls; or
- a wall and an opening, in which case it will face the opening and away from the wall.

#### Adjacent fixed openings

Where there are adjacent openings on fixed pieces and those openings are joined by a fixed path, then the orientation of the two pieces adjacent to those openings can be fixed. Elbows and tees will face way from the other opening, because if the faced the other opening they would join (if the other piece were an elbow or tee), or leave an un-joinable opening (if the other piece were a stright or head). This is because loops and open ends are not permitted. We alrady have strategies for heads or straights adjacent to the openings.

#### Corridors

Once a fair number of pieces have been fixed, corridors of unfixed pieces one piece wide are sometimes formed. When they do, and there is an end to the corridor, then all the pieces in the corridor can be fixed. Also if there are two heads in the middle of an open corridor then they can be fixed (as they can not face each other) and every piece in both directions down the corridor from these two can be fixed. [This later case not illustrated.]

#### Repetition

In this example the solution can be found by repeating these strategies until all pieces have been fixed.

#### Other strategies

Other strategies [which were not needed in this example], include:

**Multiple heads aginst a wall**- Where several unfixed heads are in a line adjacent to a wall (fixed pieces with no openings), then the heads in the middle must face away from the wall.
**Heads in a corner**- Where two adjacent unfixed heads are against a wall, and one of the heads is in a corner between two walls, then the one in the corner must face away from the walls and the other head.
**Semi-fixed elbow and two heads**- When an elbow is semi-fixed to a head and one option is to join the other end of the elbow to another head, then this position is not valid, so the elbow must point in the other direction.
**Adjacent fixed pieces with matching number of closed sides**- If the number of closed sides of fixed pieces adjoining a piece is equal to the number of closed sides that piece has, then the orientation of that piece can be fixed. [This strategy was suggested to me by Lars Huttar. It is the opposite of the “Adjacent fixed pieces with matching number of openings” strategy (which is a generalisation of “Fixed elbows a.”) and this strategy is a generalisation of “Fixed elbows b.”]

## Multiple Solutions

Some games have multiple solutions. In most cases this occurs when four or six adjacent pieces can be placed in different positions and still produce a valid solution (all users happy).

In other games a loop corridor will appear around a central island and the pieces in the corridor can face in either direction around the corridor to produce a valid solution.

Occasionally a larger number of pieces will not be fixed and there will be multiple possible solutions.

Hi,

I’m a fan of seriesOfTubes too.

Nice collection of solving strategies. Many of them match what I’ve developed over time as well.

The one called “Adjacent fixed pieces with matching number of openings” took me a while to understand what you meant. I would clarify it as follows…

“If the fixed pieces adjacent to a piece have the same *total* number of openings *on their adjoining sides* as that piece has, then the orientation of that piece can be fixed.”

You can also make a converse rule,

“If the number of closed sides of fixed pieces adjoining a piece is equal to the number of closed sides that piece has, then the orientation of that piece can be fixed.”

Not sure I expressed that well but hopefully the point is clear.

This rule would then have as a corollary your “Tee with back to wall” rule, because the one closed side of the fixed wall must adjoin the one closed side of the Tee.

These two rules also entail 1 and 2 of “Fixed elbows”.

Fun stuff!

I’m working on a 3D version of netwalk that I hope to release one of these months. One thing I appreciate about Huang’s version is that he kept it simple… E.g. he did not try to guarantee a unique solution (which would require a lot of programming effort, and clearly the game is plenty of fun without it).

Lars

Lars,

Thank you for your suggestions, most of which I have incorporated into my original post.

Michael.