python - How to order/sort a 2D table of dependencies -
i'm curious if there higher level theory/approaches/algorithm solving problem have.
i'm working on network routing problem (a proprietary radio network). way of example, have network of 5 devices. each device, can measure how can hear other devices. 0th root node interesting source. in table form, might end like:
_0_ _1_ _2_ _3_ _4_ 1 | 21 - 42 55 0 2 | 0 63 - 18 20 3 | 20 0 0 - 0 4 | 0 0 13 0 -
each row indicates how device can hear other 5 sources. want sort them each device gets best sum signals preceding elements. simple case, ordering might 1, 3, 2, 4
. 3, 1, 2, 4
. in fact, second better because 1 can hear both 0 , 3. 3, 2, 1, 4
work well.
i'm trying determine kind of algorithm can use order these. there's bit of traveling salesmen it, , don't need "best" sort. pretty sort. need scale 9 devices 10 sources.
any thoughts, help, nudges, tips, hints appreciated.
this problem can modeled minimum feedback arc set problem, np-hard problem. original graph complete directed graph, weight of each edge (v0, v1)
being signal strength v0
v1
. after computing maximum feedback arc set, topological sort give ordering has maximum total signal.
Comments
Post a Comment