Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
156 views
in Technique[技术] by (71.8m points)

Is there an algorithm out there for creating a limitless branch of clustered nodes?

For a school project I'm looking to create random examples of connected branches of clusters of nodes that don't overlap as per the picture. But imagine 50,000 or more of these connected clusters.

Can anyone point me in the direction of any algorithms that I could learn from?

enter image description here

question from:https://stackoverflow.com/questions/65854535/is-there-an-algorithm-out-there-for-creating-a-limitless-branch-of-clustered-nod

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I'd start with a Voronoi diagram to allocate an area for each of the 50000 clusters. Build the cluster inside its assigned area. Make connections between clusters that share a border. The connecting line should stay within the area assigned to the two clusters, e.g. the green line is a valid connection, but the red line is not.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...