Week1-報告

題庫調查

重新調查了300題於101圍棋網上的紀錄,用以辨認是死活題還是官子題,於辨認的過程中發現有欣賞題標籤,除去B的一題實為死活題外,其餘皆為不須再下棋的著手(已到終局型態)或者無解且都在D級題庫裡,對於此發現做註記

具體題目

具體題目

題型與對錯是否有關聯?

以新增撲版判斷

答對答錯正確率
死活331964.7%
官子81044.4%

C級

答對答錯正確率
死活162242.1%
官子31516.6%

B級

答對答錯正確率
死活21611.1%
官子3537.5%

A級

題型與對錯是否有關聯?

無限制版的數據

答對答錯正確率變動比例
死活50296.1%32%(↑)
官子14444.4%33%(↑)

C級

B級

A級

答對答錯正確率變動比例
死活271171%28.9%(↑)
官子14477.7%61%(↑)
答對答錯正確率變動比例
死活41422.2%11%(↑)
官子5362.5%25%(↑)

目前看起來並沒有顯著的關聯性與特徵

 

新增知識手順-撲

1. 建立對於弱連通塊的氣計算

仿造get_connected_part之定義,建立calculate_liberty_weak_connect函數

在弱連通塊的兩個corner分別假裝下一子後,使其變成強連通塊,取氣的min以後-1

2. 原先自殺會被is rational movement函數擋住,現在另開判斷,如果下了以後弱連通塊氣有減少,則判斷為撲

Before

有解無解
C2743
B1640
A422
S08
有解無解
C4129
B1937
A521
S08

AFTER

由此可知,新增撲為知識棋步以後,C級的解答率明顯上升,BAS級變動較小,為一辨識的有效策略

Time: 86s

Time: 172s

bool is_oshi_structural(int color, pair<int, int> pt) {
    if (!is_legal_movement(color, pt))
        return false;
    const int opp = -color;
    int weak_lib_before[4];
    bool adj_opp[4] = {false, false, false, false};
    bool has_adj_opp = false;

    for (int d = 0; d < 4; d++) {
        int ny = pt.first + dir[d][0];
        int nx = pt.second + dir[d][1];
          
        if (out_of_edge({ny, nx}))
            continue;

        if (get_board(ny, nx) == opp) {
            adj_opp[d] = true;
            has_adj_opp = true;
            weak_lib_before[d] = calculate_liberty_weak_connect({ny, nx});
        }
    }
    if (!has_adj_opp)
        return false;
    add_stone(color, pt);
    if (calculate_liberty(pt) > 1) {
        undo();
        return false;
    }
    bool liberty_decreased = false;

    for (int d = 0; d < 4; d++) {
        if (!adj_opp[d])
            continue;
        int ny = pt.first + dir[d][0];
        int nx = pt.second + dir[d][1];
        if (get_board(ny, nx) != opp) {
            liberty_decreased = true;
            continue;
        }
        int weak_lib_after = calculate_liberty_weak_connect({ny, nx});
        if (weak_lib_after < weak_lib_before[d])
            liberty_decreased = true;
    }
    undo();
    return liberty_decreased;
}
bool is_oshi_structure (color, pt) 
	if illegal
    	return false
    if not adjacent to opponent
    	return false
    add_stone(pt)
    if (calculate_liberty(pt) > 1)
    	return false
    for {ny, nx} in four direction next to pt
    	if (calculate_liberty_weak_connect({ny, nx})
    

不限制知識棋步時的比較

有解無解
C646
B3620
A917
S17
有解無解
C4129
B1937
A521
S08

DEPTH-6

可以看到對於B級將深度由6提升至8以後,正解明顯提升,可做為一個分水嶺

 

因此想探討為何在不限制棋步的狀況下,仍有所謂無解的表現,原因應該與上個學長week-8對於終局的判斷(is_end_2)有關

有解無解
C682
B506
A179
S35

DEPTH-8

Time: 459s

Time: 1343s

錯題分析

現有盤面判斷邏輯

bool res = game.win_with_depth(1, 8, 0, 0, 1, 0) ||
                       game.defend_by_seki(1) || game.win_within_one_move(1);

大多判斷的邏輯使用win_with_depth函數

錯題分析

win_with_depth邏輯

1. capture_with_eye有眼殺瞎檢查

2. win_by_kill_all 用於死活題的通殺檢查

3. 使用is_end_2函數辨認終局,接著使用win_by_territory判斷是否已比目法勝利

is_end_2邏輯

1. 移除必死子

2. 找出主要棋塊

3. 加回必死子

4. 判斷為true_end or pseudo_end

 

-> 此時會影響判斷4的alive_with_eyes函數判斷?

if(end){
	// cout<<"check\n";
	//若符合其他條件,則根據主要棋塊狀態決定終局狀態
	bool state_self = alive_with_eyes(color);
	bool state_opponent = alive_with_eyes(-color);
	if(state_self and state_opponent)
		return true_end;
	else{
		if(state_self and alive_within_one_move(-color)){
			return pseudo_end;
		}
		else{
			if(is_seki()){
				return true_end;
			}
		}
	}
}

對手全滅的情況會被忽略不計

但是全滅是另一個函數win_by_kill_all會擋住?

未來的可能方向

1. 若該手下完後剩下一氣,則使當前對手提子後不減少深度繼續搜尋

若當前落子為叫吃,則使當前對手連回被叫吃子,不減少深度繼續搜尋

此條目可能導致假解或無解的方向,高級的偵測器可能可以改進,但可能會增加深度

此兩題均為B級depth-8情況下無解之題目,有此著手

未來的可能方向

1. 若該手下完後剩下一氣,則使當前對手提子後不減少深度繼續搜尋

若當前落子為叫吃,則使當前對手連回被叫吃子,不減少深度繼續搜尋

 

此條目可能導致假解或無解的方向,高級的偵測器可能可以改進,但可能會增加深度

也可以判斷更改前與更改後的變化,查看是否有助於判斷等級

Minimal

By yujuan

Minimal

  • 30