generate topology def