random_start.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:machine-learning 作者: zzw0929 项目源码 文件源码
def  hill_climbling_first_choice(status):
    '''??????????????????????????????????????

    ??????????
    '''
    global chess_status_count
    pos = [(x, y) for x in range(8) for y in range(8)]
    random.shuffle(pos)
    for col, row in pos:
        if status[col] == row:
            continue
        chess_status_count += 1
        status_copy = list(status)
        status_copy[col] = row
        if get_num_of_conglict(status_copy) < get_num_of_conglict(status):
            status[col] = row
            return status
    return status
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号