This recurrence allows us to compute every score si,j in a single sweep of
the grid. The algorithm MANHATTANTOURIST implements this procedure.
Here,
#w
is a two-dimensional array representing the weights of the grid’s
edges that run north to south, and
!
w is a two-dimensional array representing
theweights of the grid’s edges that runwest to east. That is,
#w
i,j is theweight
of the edge between (i, j − 1) and (i, j); and
!w
i,j is the weight of the edge
between (i, j − 1) and (i, j).
เกิดขึ้นนี้ช่วยให้เราคำนวณทุกคะแนนซี เจในกวาดเดียวของตาราง อัลกอริทึม MANHATTANTOURIST ใช้ขั้นตอนนี้ที่นี่#wอาร์เรย์สองมิติจะแสดงน้ำหนักของของตารางขอบที่เหนือใต้ และ!w เป็นอาร์เรย์สองมิติแทนtheweights ของตาราง edges ที่ runwest ไปตะวันออก นั่นก็คือ#w, j เป็น theweightของขอบระหว่าง (i, j − 1) และ (i, j); และ! w, j คือ น้ำหนักของขอบระหว่าง (i, j − 1) และ (i, j)
การแปล กรุณารอสักครู่..

ซ้ำ นี้ช่วยให้เราคำนวณคะแนนทุกจังหวัด , J ในการกวาดเดียว
ตาราง ขั้นตอนวิธี manhattantourist ใช้ขั้นตอนนี้
w
ที่นี่#เป็นอาร์เรย์สองมิติแทนน้ำหนักของ
ตารางขอบที่วิ่งเหนือใต้และ
!
w
theweights เป็นอาร์เรย์สองมิติที่เป็นตัวแทนของเส้นขอบที่ runwest ตะวันออก นั่นคือ #
w
, J theweight
ของขอบระหว่าง ( I , J − 1 ) ( i , j ) ;
! w
I , J คือน้ำหนักของขอบ
ระหว่าง ( I , J − 1 ) ( i , j )
การแปล กรุณารอสักครู่..
