# Tangled cable - divide and conquer

Tangled cable: Let's have a long cable, from both ends of which protrudes n wires. Each wire at the left end is connected to just one at the other end and we want to find out which one. To do this, we can use the following operations: (1) apply voltage to a given wire at the left end, (2) disconnect voltage from a given wire at the left end, (3) measure the voltage at a given wire at the right end. What is the best algorithm that uses these operations to find out what is connected to what. Could it be done with the divide and conquer method? In what time complexity? The only solution I could figure out is to check each cable with each cable until we find match and then repeat with next cable.

• Does knowing a the endpoints of a given wire give you any information about another wire(s) ?? If not then the fastest algorithm would be $\Omega(n)$ – droptop May 30 at 17:05
• what is the algorithm? – Rikib1999 May 30 at 21:46