Make assign_part() into a function, and make not-connected node names unique.