fbpx
วิกิพีเดีย

การค้นหาเฉพาะที่

การค้นหาเฉพาะที่ (อังกฤษ: local search) เป็นกลวิธีในการใช้ค้นหาคำตอบแบบหนึ่ง จากเซตของผลเฉลยที่มีขนาดใหญ่มากๆ ซึ่งเป็นไปไม่ได้ที่จะตรวจสอบผลเฉลยทั้งหมดเพื่อให้เจอผลเฉลยที่ดีที่สุด โดยจะมีฟังก์ชันต้นทุนสำหรับพิจารณาแต่ละผลเฉลย เพื่อเปลี่ยนแปลงสถานะของผลเฉลยปัจจุบันที่ค้นหา ไปจนกว่าจะเจอผลเฉลยที่เราพอใจ

ขั้นตอนวิธีการค้นเฉพาะที่นี้ยังเป็นกลวิธีในการแก้ปัญหาการหาค่าเหมาะที่สุดเชิงการจัด (combinatorial optimization problem) ซึ่งเป็นปัญหาเอ็นพีแบบยาก (NP-hard) อีกทั้งยังถูกนำไปประยุกต์ใช้ในหลากหลายวงการ ซึ่งสามารถหาผลเฉลยที่ดีได้สำหรับปัญหาที่พบในทางปฏิบัติ

กระบวนการทำงาน

ขั้นตอนวิธีการค้นเฉพาะที่จะเริ่มต้นจาก s โดยเป็นผลเฉลยหนึ่งที่อยู่ใน S โดย S เป็นเซตของผลเฉลยที่เป็นไปได้ทั้งหมดของปัญหา แล้วค่อยๆ ตรวจสอบผลเฉลยที่ไม่ห่างไกลจาก s มากไปเรื่อยๆ ว่ามีผลสัมฤทธิ์ที่ดีขึ้นหรือไม่ โดยเราจะมีฟังก์ชัน f(s) สำหรับใช้การคำนวณต้นทุนของผลเฉลย s ฟังก์ชันนี้จะใช้เป็นดัชนีชี้วัดความเหมาะสมของแต่ละผลเฉลย

localSearch() { s = initialSolution() while not terminate(s) { s' = select( next(s) ) if( accept(s,s') ) then s = s' } } 

รหัสเทียมข้างต้นเป็นแนวการทำขั้นตอนวิธีการค้นหาเฉพาะที่ โดยเริ่มต้นจะเริ่มจาก initialSolution() แล้วทำงานแบบวนซ้ำสำหรับในการหาผลเฉลยที่เป็นเพื่อนบ้านกับ s คือ s' โดยมีฟังก์ชัน select() เป็นตัวเลือกตัวที่พิจารณา หากผลเฉลย s' ดีกว่า s ก็จะแทนที่ s ด้วย s' โดยมี accept() เป็นตัวตัดสินว่าจะยอมรับ s' หรือไม่ การทำซ้ำนี้จะทำไปเรื่อยๆ จนกว่าความเหมาะสมของ s ที่ได้เราพอใจ

ขั้นตอนวิธีการค้นหาเฉพาะที่นี้มีหัวใจสำคัญอยู่ที่ฟังก์ชันต้นทุน หากกำหนดดีๆ การค้นหาคำตอบก็จะมีประสิทธิภาพ

ลักษณะการค้นหาเฉพาะที่นี้ ถูกนำไปใช้กับขั้นตอนวิธีเกี่ยวกับการค้นหาในแบบอื่นๆ อยู่มากมาย

ตัวอย่างขั้นตอนวิธีที่ใช้การค้นหาเฉพาะที่

  1. กลวิธีการค้นอย่างไต่เขา (Hill Climbing) หรือ กลวิธีการค้นแบบสืบเชื้อสายอย่างง่าย (Simple descent)
  2. กลวิธีการค้นแบบสืบเชื้อสายอย่างสูงชัน (Steepest descent)
  3. Simulated annealing
  4. การค้นทาบู (Tabu search)
  5. ขั้นตอนวิธีเชิงพันธุกรรม (Genetic algorithm)

อ้างอิง

การค, นหาเฉพาะท, งกฤษ, local, search, เป, นกลว, ในการใช, นหาคำตอบแบบหน, จากเซตของผลเฉลยท, ขนาดใหญ, มากๆ, งเป, นไปไม, ได, จะตรวจสอบผลเฉลยท, งหมดเพ, อให, เจอผลเฉลยท, โดยจะม, งก, นต, นท, นสำหร, บพ, จารณาแต, ละผลเฉลย, เพ, อเปล, ยนแปลงสถานะของผลเฉลยป, จจ, นท, นหา, . karkhnhaechphaathi xngkvs local search epnklwithiinkarichkhnhakhatxbaebbhnung cakestkhxngphlechlythimikhnadihymak sungepnipimidthicatrwcsxbphlechlythnghmdephuxihecxphlechlythidithisud odycamifngkchntnthunsahrbphicarnaaetlaphlechly ephuxepliynaeplngsthanakhxngphlechlypccubnthikhnha ipcnkwacaecxphlechlythieraphxickhntxnwithikarkhnechphaathiniyngepnklwithiinkaraekpyhakarhakhaehmaathisudechingkarcd combinatorial optimization problem sungepnpyhaexnphiaebbyak NP hard xikthngyngthuknaipprayuktichinhlakhlaywngkar sungsamarthhaphlechlythidiidsahrbpyhathiphbinthangptibtikrabwnkarthangan aekikhkhntxnwithikarkhnechphaathicaerimtncak s odyepnphlechlyhnungthixyuin S ody S epnestkhxngphlechlythiepnipidthnghmdkhxngpyha aelwkhxy trwcsxbphlechlythiimhangiklcak s makiperuxy wamiphlsmvththithidikhunhruxim odyeracamifngkchn f s sahrbichkarkhanwntnthunkhxngphlechly s fngkchnnicaichepndchnichiwdkhwamehmaasmkhxngaetlaphlechly localSearch s initialSolution while not terminate s s select next s if accept s s then s s rhsethiymkhangtnepnaenwkarthakhntxnwithikarkhnhaechphaathi odyerimtncaerimcak initialSolution aelwthanganaebbwnsasahrbinkarhaphlechlythiepnephuxnbankb s khux s odymifngkchn select epntweluxktwthiphicarna hakphlechly s dikwa s kcaaethnthi s dwy s odymi accept epntwtdsinwacayxmrb s hruxim karthasanicathaiperuxy cnkwakhwamehmaasmkhxng s thiideraphxickhntxnwithikarkhnhaechphaathinimihwicsakhyxyuthifngkchntnthun hakkahnddi karkhnhakhatxbkcamiprasiththiphaphlksnakarkhnhaechphaathini thuknaipichkbkhntxnwithiekiywkbkarkhnhainaebbxun xyumakmaytwxyangkhntxnwithithiichkarkhnhaechphaathi aekikhklwithikarkhnxyangitekha Hill Climbing hrux klwithikarkhnaebbsubechuxsayxyangngay Simple descent klwithikarkhnaebbsubechuxsayxyangsungchn Steepest descent Simulated annealing karkhnthabu Tabu search khntxnwithiechingphnthukrrm Genetic algorithm xangxing aekikhLocal Search Algorithms Archived 2011 08 20 thi ewyaebkaemchchin Heuristic Search Techniques lingkesiy karxxkaebbxlkxrithumekhathungcak https th wikipedia org w index php title karkhnhaechphaathi amp oldid 9614379, wikipedia, วิกิ หนังสือ, หนังสือ, ห้องสมุด,

บทความ

, อ่าน, ดาวน์โหลด, ฟรี, ดาวน์โหลดฟรี, mp3, วิดีโอ, mp4, 3gp, jpg, jpeg, gif, png, รูปภาพ, เพลง, เพลง, หนัง, หนังสือ, เกม, เกม