私はパレートのフロンティアを見つける必要がある3D空間にポイントのセットを持っています。ここでは実行のスピードが非常に重要であり、テストにポイントを追加すると時間が非常に長くなります。Pythonのパレートフロントの高速計算
点の集合は次のようになります。今
[[0.3296170319979843, 0.0, 0.44472108843537406], [0.3296170319979843,0.0, 0.44472108843537406], [0.32920760896951373, 0.0, 0.4440408163265306], [0.32920760896951373, 0.0, 0.4440408163265306], [0.33815192743764166, 0.0, 0.44356462585034007]]
、私は、このアルゴリズムを使用しています:
ここで見つけるdef dominates(row, candidateRow):
return sum([row[x] >= candidateRow[x] for x in range(len(row))]) == len(row)
def simple_cull(inputPoints, dominates):
paretoPoints = set()
candidateRowNr = 0
dominatedPoints = set()
while True:
candidateRow = inputPoints[candidateRowNr]
inputPoints.remove(candidateRow)
rowNr = 0
nonDominated = True
while len(inputPoints) != 0 and rowNr < len(inputPoints):
row = inputPoints[rowNr]
if dominates(candidateRow, row):
# If it is worse on all features remove the row from the array
inputPoints.remove(row)
dominatedPoints.add(tuple(row))
elif dominates(row, candidateRow):
nonDominated = False
dominatedPoints.add(tuple(candidateRow))
rowNr += 1
else:
rowNr += 1
if nonDominated:
# add the non-dominated point to the Pareto frontier
paretoPoints.add(tuple(candidateRow))
if len(inputPoints) == 0:
break
return paretoPoints, dominatedPoints
:http://code.activestate.com/recipes/578287-multidimensional-pareto-front/
見つけるための最速の方法は何アンサンブルのソリューションで非支配ソリューションのセット?つまり、要するに、Pythonはこのアルゴリズムより優れていますか?
うわー、私はそれを逃した、ピーターありがとう! – Rodolphe
コスト配列は、コスト[i、j]がj番目である2次元配列にすぎないことに注意してください。あなたのinputPoints配列と同じだと思います。[ここでのテスト](https://github.com/QUVA-Lab/artemis/blob/master/artemis/general/)を見ることができます。 test_pareto_efficiency.py)を使用しています。 – Peter