The snapshot is a tutorial of Switch.
You see the bellow snapshot, from the ROOT SW1 node to SW3, there are two path:

the author says the the path1(left side path) cost is 0 + SW3-in-port. the path2(right side path) cost is 0 + SW2-in-port + SW3-in-port.
there I have a doubt, why author do not use the passing Switches node as the cost value? if the data passing port can represent cost, why the Switch out port do not have value?