I developed an algorithm that finds the minimum independent dominating set of a graph based on a distance constraint. (I used Python and NetworkX to generate graphs and get the pairs)
The algorithm uses a brute force approach:
- Find all possible pairs of edges
- Check which nodes satisfy the distance constraint
- Find all possible independent dominating sets
- Compare the independent dominating sets found and find the minimum dominating set
For small number of nodes it wouldnt make a difference but for large numbers the program is really slow.
Is there any way that I could make it run faster using a different approach?
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…