multiple module design using One Wire DS2401 ?

Take as example a DS18B20 Digital temperature sensor and the way one sensor can be connected to each other.

I am interested on using this design for an application where I have multiple modules connected to each other by two pins (parasitic power, ground) having the last device on the line connected to arduino. (Connections are less than 5 cm length).

Each device would have four ways to connect to each other via four different sockets (s1 ... s4), aways using up to 2 pins.

deviceA deviceB deviceC
arduino pin 2 ------ (s1), (s2), s3, s4 ---- s1, (s2), s3, (s4) ---- s1, (s2), s3, s4
ground ------ gnd ---- gnd ---- gnd

Arduino (only) needs to be aware of how devices were connected to each other and avoid ambiguity.
Furthermore, there will be cases where a device could be connected to three devices, creating branches:

deviceA deviceB deviceC
arduino pin 2 ------ (s1), (s2), s3, s4 ---- s1, (s2), s3, (s4) ---- s1, (s2), s3, s4
ground ------ gnd ---- gnd ---- gnd
||
deviceD
(s1), s2, s3, s4
gnd
also a looping case:

deviceA deviceB
arduino pin 2 ------ (s1), (s2), (s3), s4 ---- s1, (s2), s3, (s4)
ground ------ gnd ---- gnd
|| ||
deviceC deviceD
(s1), s2, s3, (s4) ---- (s1), (s2), s3, s4
gnd ---- gnd

I was reading about this IC, but not sure if I can implement on this project (Read ROM seems not to recommended for this design, maybe Search ROM?) . Even if I could use these ICs on each device socket, I could maybe end up with a list of PRESENT sockets but I am thinking how to associate them to represent the map of connections. I would have to previously map all ICs and that would also be a limitation.

Is there any feasible solution? if I could add one more wire to the design, maybe using attiny as slave on each device to read voltage on its sockets and yet use that socket pin for powering and communicate with master?

Each device would have four ways to connect to each other via four different sockets (s1 ... s4), aways using up to 2 pins.

Using up to 2 pins? Doesn't it have to be always 2 pins?

What's the output you expect? Does the Arduino just have to find out which devices are connected? Or does have to know the exact structure of all connections? Does it have to know which of the four sockets was used for the connection?

pylon:
Doesn't it have to be always 2 pins?

Sorry. I meant 2 pins for each socket.

DS2401 ICs can be placed in a GND and DATA line and they will be recognized by arduino in the same numerical order, no matter how the order they are attached to each other, using Normal Search.
I can map each set of IC to each device and make them present only when the socket is being used. If I could get the ids in a certain order - based on its position on the data line (for example) - I am almost sure I can track how devices are connecting. I am trying to understand how search algorithm is performed.

Considering the connections diagrams I posted earlier, and supposing I could iterate the search in the order ICs are visually found in data line, I would expected something like this:

//each of these are constant values for mapped ids: 
//deviceA
dAs1 = 22C4FF1A;
dAs2 = AAE3D4A0;
dAs3 = 126EC003;
dAs4 = 44DFF102;
and so on...

case 1 OUTPUT:
->dAs1 -> dAs2 -> dBs2 -> dBs4 -> dCs2

case 2 OUTPUT:
dAs1 -> dAs2 -> dBs2 -> dCs2, dBs4 -> dDs1

case 3 OUTPUT:
dAs1 -> dAs2 -> dBs2 -> dBs4 -> dDs2 -> dDs1 -> dCs4 -> dCs1 -> dAs3 // or
dAs1 -> dAs3 -> dCs1 -> dCs4 -> dDs1 -> dDs2 -> dBs4 -> dBs2 -> dAs2 //

I believe I need to know the structure of the connections more than which socket is being used, I think.

and supposing I could iterate the search in the order ICs are visually found in data line

But that will never work. The ICs have no clue in what order they appear on the bus. That's because it is a bus and not an array of ICs where the signal goes into the chip on one pin and out on another.