5.1 小型問題效能評估
5.1.2 實驗結果與分析
國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
58
第5章 效能評估
這一章中,將針對我們所提出的控制點選擇問題之模型做幾個實驗,以評估不同模型 下的搜尋行動代理人之效率。
5.1 小型問題效能評估
由於 CPSP-Coverage 及 CPSP-Utility 皆為 NP-complete 問題,因此,我們將分別利用 4.2.2 與 4.2.3 所提出的 NPF 與 NPF-U 啟發式演算法來求得次佳解,並針對在 4.2 中的 表 4.1 所列之評估指標,來與其最佳解做比較,以分析各別演算法與最佳解之間的效 能差異。因最佳解所耗費的計算資源龐大,故只適合少數的小型問題。
5.1.1 實驗環境的參數設定
我們將隨機產生 5 個 Graph,參數設定如下︰
• The total number of candidate control points = 20。
• The total number of trails = 8。
• Available resources = 12。
• The cost of each candidate control point =1∼5。
• The edge_weight between candidate control point =1∼5。
5.1.2 實驗結果與分析
下圖 5.1 圖 5.2 為 CPSP-Coverage 的實驗結果,分別列出 NPF 演算法與 optimal
‧
solution 所求得的 number of covered edges、mean_MC_distance,與 optimal solution 所 求相比較。而由於 max_MC_distance 與 optimal solution 所求相同,故不以圖表列出。
圖 5.1︰CPSP-Coverage—NPF vs. Optimal solution (no. of covered edges)。
圖 5.2︰CPSP-Coverage—NPF vs. Optimal solution (mean_MC_distance)。
Graph 1 Graph 2 Graph 3 Graph 4 Graph 5
NPF 48 46 44 44 50
no. of covered edges
CPSP-Coverage
Graph 1 Graph 2 Graph 3 Graph 4 Graph 5
NPF 1.55 1.55 1.65 1.62 1.53
Optimal 1.55 1.55 1.65 1.6 1.53
1.46
‧
solution 少 1 個 edge,這是因為 NPF 演算法會優先選擇 node_potential、trail_hit_count 較高的候選控制點,然而,就如同 0-1 knapsack problem,這樣做並不能保證所得到的 profit 最高,因此,在某些情況下就會造成 NPF 演算法的 number of covered edges 效率 低於 optimal solution。由圖 5.2 可知,在 Graph 4 中 NPF 演算法所求的 mean_MC_distance 比 optimal solution 高 0.02 個 edge,這是由於在此 Graph 中,optimal solution 所選的候選控制點 在所有 trail 上出現的比例較 NPF 演算法所選的來得高,故較容易找到距離行動節點較 近的控制點,因此,在此情況下就會造成 optimal solution 所求的 mean_MC_distance 效率優於 NPF 演算法。
下圖 5.3 圖 5.4 為 CPSP-Utility 的實驗結果,分別列出 NPF-U 演算法與 optimal solution 所求得的 total weight of covered edges、mean_weighted_MC_distance。而由於 max_weighted_MC_distance 與 optimal solution 所求相同,故不以圖表列出。
圖 5.3︰CPSP-Utility—NPF-U vs. Optimal solution (total weight of covered edges)。
Graph 1 Graph 2 Graph 3 Graph 4 Graph 5
NPF-U 124 93 103 109 129
Optimal 124 93 107 109 130
0
total weight of covered edges
CPSP-Utility
‧
圖 5.4︰CPSP-Utility—NPF-U vs. Optimal solution (mean_weighted_MC_distance)。
由圖 5.3 可知,在 Graph 3、Graph 5 中,NPF-U 演算法所求的 total weight of covered edges 分別比 optimal solution 少 4 個、1 個 edge_weight,原因同上圖 5.1 所述,這也 是因為 NPF-U 演算法的控制點選擇機制所導致。
而由圖 5.4 可知,在 Graph 3 中,NPF-U 演算法所求的 mean_weighted_MC_distance 比 optimal solution 低 0.05 個 edge_weight,這是由於在此 Graph 中,NPF-U 演算法所 選的候選控制點在所有 trail 上出現的比例較 optimal solution 所選的來得高,故所求的 mean_weighted_MC_distance 效率高於 optimal solution。反之,在 Graph 5 中,NPF-U 演算法所選的候選控制點在所有 trail 上出現的次數與 optimal solution 相同,故考慮此 Graph 中 edge_weight 的差異下, NPF-U 演算法的 mean_weighted_MC_distance 效率 略低於 optimal solution。
為了分析上圖 5.1-圖 5.4 中,NPF、NPF-U 所求與最佳解的差異程度,我們將表 4.1 的評估指標做正規化,產生以下幾個新的評估指標 (單位為%),定義如下︰
Graph 1 Graph 2 Graph 3 Graph 4 Graph 5
NPF-U 3.41 2.92 3.48 3.55 3.33
Optimal 3.41 2.92 3.53 3.55 3.31
0
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
62
Error in covered edge︰( number of covered edges (optimal)–number of covered edges (heuristic)) ∕ number of covered edges (optimal)。
Error in total weight of covered edges︰(total weight of covered edges (optimal)–
total weight of covered edges (heuristic)) ∕ total weight of covered edges (optimal)。
Error in mean_MC_distance︰(mean_MC_distance (heuristic) –mean_MC_distance (optimal)) ∕ mean_MC_distance (optimal)。
Error in max_MC_distance︰(max_MC_distance (heuristic) –max_MC_distance (optimal)) ∕ max_MC_distance (optimal)。
Error in mean_weighted_MC_distance︰(mean_weighted_MC_distance (heuristic)–
mean_weighted_MC_distance (optimal) ) ∕ mean_weighted_MC_distance (optimal)。
Error in max_weighted_MC_distance︰(max _weighted_MC_distance (heuristic)–
max _weighted_MC_distance (optimal) ) ∕ max _weighted_MC_distance (optimal)。
由圖 5.5 圖 5.6 以及表 5.1︰CPSP-Coverage—NPF vs. Optimal solution (Error)。可 知,NPF 演算法所求之 number of covered edges,最多比 optimal solution 少 1 個 edge,
低於 optimal solution 所求 2.22%,mean_MC_distance 所求則最多比 optimal solution 多 0.02 個 edge,高於 optimal solution 所求 1.25%。此外,max_MC_distance 與 optimal solution 所求相同。
‧
圖 5.5︰CPSP-Coverage—NPF vs. Optimal solution (Error in covered edges)。
圖 5.6︰CPSP-Coverage—NPF vs. Optimal solution (Error in mean_MC_distance)。
0.00 0.00 0.00
Graph1 Graph2 Graph3 Graph4 Graph5
Error in covered edge (%)
CPSP-Coverage
Graph1 Graph2 Graph3 Graph4 Graph5
Error in mean_MC_distance (%)
CPSP-Coverage
‧ 國
立 政 治 大 學
‧
N a tio na
l C h engchi U ni ve rs it y
64
表 5.1︰CPSP-Coverage—NPF vs. Optimal solution (Error)。
由圖 5.7 圖 5.8 以及表 5.2 可知,NPF-U 演算法所求之 total weight of covered edges,其所涵蓋的 edge 權重最多比 optimal solution 少 4。然而,在
mean_weighted_MC_distance 則有機會優於 optimal solution 所求,這是因為在 CPSP-Utility 模型中,optimization objective 是 total weight of covered edges,而非 mean_weighted_MC_distance。此外,max_weighted_MC_distance 與 optimal solution 所 求相同。
CPSP-Coverage
Graph1 Graph2 Graph3 Graph4 Graph5
no. of covered edges 0 0 0
Difference = 1 Error = 2.22%
0
mean_MC_distance 0 0 0
Difference = 0.02 Error = 1.25%
0
max_MC_distance 0 0 0 0 0
‧
圖 5.7︰CPSP-Utility—NPF-U vs. Optimal solution (Error in total weight of covered edges)。
圖 5.8︰CPSP-Utility—NPF-U vs. Optimal solution (Error in mean_weighted_MC_distance)。
Graph1 Graph2 Graph3 Graph4 Graph5
Error in total weight of covered edges (%)
CPSP-Utility
Graph1 Graph2 Graph3 Graph4 Graph5
Error in mean_weighted_MC_distance (%)
CPSP-Utility
‧
表 5.2︰CPSP-Utility—NPF-U vs. Optimal solution (Error)。