Shortest Path using alternating Relationship Properties

Hello,
I'm new to neo4j and I need to write a query which will give me the shortest path between 2 'Equipment' nodes using the 'CAN_CONNECT_TO' relationship between 'Port' nodes.

All nodes have a 'CAN_CONNECT_TO' relationship between them that have a property 'type'. A property 'type' can be either 'PIPE', 'HOSE' or 'WIRE'. I need the shortest path via the 'CAN_CONNECT_TO' relationship where the relationship 'type' alternates from 'PIPE' to either 'HOSE' or 'WIRE'.

For example, I need my path to have 'CAN_CONNECT_TO' relationship type pattern of:
'PIPE'->'HOSE'->'PIPE'->'HOSE'->'PIPE'->'WIRE'->'PIPE'
It doesn't matter if the type is 'HOSE' or 'WIRE' as long as there is a 'PIPE' type relationship before and after the 'HOSE' or 'WIRE' type property. For example, this is what I want to avoid:
'PIPE'->'HOSE'->'HOSE'->'PIPE'->'WIRE'->'HOSE'->'PIPE'

Below is a snip of the cypher query I am currently using which gives the shortest path between 'Equipment' nodes via the 'CAN_CONNECT_TO' relationship but I do not have the pattern I want.
The 'PIPE'->'HOSE'->'WIRE'->'HOSE'->'PIPE' properties we can see in the attached snip.

How can I enforce a pattern of every other relationship needs to be 'PIPE'?

Alternatively, is it possible to return each “pair” of nodes that share a :CAN_CONNECT_TO type: 'PIPE' relationship and then find the shortest path from a to b, traversing through x pairs of nodes

Here is my current query:

MATCH
(a:Equipment {name: '352'}),
(b:Equipment {name: '1006'}),
path=shortestPath((a)-[:CAN_CONNECT_TO*]-(b))
WHERE ALL(n in nodes(path) WHERE n:Port OR n = a OR n= b)
RETURN path

Any help is greatly appreciated. Thanks in advance!

Hi @anthony.sotomayor ,

Take a look on Expand paths with config - APOC Extended Documentation

It may help you ;)