It certainly is a cost driver when you have shipyards that are not building the same ship. When you attribute the contract to two different shipyards it increases the cost.
There are other factors than cost that enter into that decision-making process, which I don't comment on, like regional economic benefits and so on.