Do you have an example for a topological search via scripting?

Category:
Scripting
Summary

Sometimes a topological search over connected elements is necessary in DPL or Python scripts. Depending on the task, different approaches might be better in regards to performance and results. This FAQ shall demonstrate one of these possibilites. 

Answer

The attached Python script is a small example on how a topological search might be performed. The attached example starts from a busbus, which must be marked in the single line diagram and does a breadth first topological search to go through the network. 

In this example the stop critereon is a change in the voltage level of more than 10% in regards to the starting terminal. Finally all found busbars are printed in the output window.

Of course other search options and stop criteria are possible as well and this shows only one possible example. 

Back