1 / 52

Swarm Intelligence Part 1 Ants Algorithm

Swarm Intelligence Part 1 Ants Algorithm. BIONICS. طبيعت منبع الهام و الگو گرفتن برای بسياری از تحقيقات و پيشرفت های علمی بوده است به عنوان مثال: الگوريتم های ژنتيک Genetic Algorithms شبکه های عصبی Neural Networks سيستم های خودسازمان ده Self-organizing Systems

georgio
Download Presentation

Swarm Intelligence Part 1 Ants Algorithm

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Swarm IntelligencePart 1Ants Algorithm

  2. BIONICS • طبيعت منبع الهام و الگو گرفتن برای بسياری از تحقيقات و پيشرفت های علمی بوده است • به عنوان مثال: • الگوريتم های ژنتيک Genetic Algorithms • شبکه های عصبی Neural Networks • سيستم های خودسازمان ده Self-organizing Systems • گروهی از این موارد بر اساس رفتار برخی از حشرات مثل مورچه ها و زنبور عسل که رفتار اجتماعی دارند بوده است • در زمینه شبکه بر این اساس الگوريتم های قدرتمندی برای کاربردهايی مثل مسیريابی و توزیع بار طراحی شده اند • BIONICS: Application of biological principles to the study and design of engineering systems.

  3. Swarm Intelligence “any attempt to design algorithms or distributedproblem-solving devices inspired by the collectivebehavior of social insect colonies and other animal societies” [Bonabeau, Dorigo, Theraulaz: SwarmIntelligence, p. 7]

  4. مدل سازی و طراحی الگوريتم

  5. Ants مورچه ها • مورچه ها يکی از شگفت انگيزترين موجودات عالم هستند. • مورچه ها به صورت گروهی فعاليت های پيچیده ای را انجام می دهند: • کشف و انتقال غذا در حجم کم يا زياد • ذخیره سازی غذا • لانه سازی پيچيده • تميزکاری لانه • محافظت از تخم ها • تشکيل پل برای عبور از آب • کشاورزی • گله داری • .........

  6. ويژگی مشترک • تک تک مورچه ها حرکاتی ساده و بعضا بدون نظم خاص انجام می دهند • اما در مجموع از برآيند حرکات آنها نظمی خاص وگاها بسيار پيچیده پديد می آید. • هیچ نوع هدايت و رهبری در اين امر دخالت ندارد.

  7. Emergence • Emergence وقتی اتفاق می افتد که تعدادی عوامل ساده مرتبط با هم به گونه ای هماهنگ عمل می کنند که منجر به رفتار هوشمند پيچیده ای می شود. • این يک فرایند از پايين به بالا است: Emergence از متن جمعیت عوامل شروع می شود و هيچگونه رهبری و مديریتی در آن صورت نمی گیرد. • Unique global behavior arising from the interaction of many agents • رفتار کلی که از برآيند تعامل تعداد زيادی از عوامل جزء پديد می آيد

  8. Emergence • Emergence در سيستم های متعددی اتفاق می افتد: زندگی جمعی حيوانات و خاصا بعضی از حشرات، مغز انسان، سيستم دفاعی بدن انسان،رفتارهای اجتماعی انسان ها، سیتم شهرسازی و زندگی شهری انسان و..... • در هر يک از اين سيستم ها عوامل موجود در يک سطح منجر به بروز رفتار يا ويژگی در سطح بالاتر می شوند. • Unique global behavior arising from the interaction of many agents • رفتار کلی که از برآيند تعامل تعداد زيادی از عوامل جزء پديد می آيد "EMERGENCE The connected lives of ants, brains, cities, and software" by Steven Johnson

  9. رفتار مورچه ها • هر مورچه الگوريتم ساده ای را اجرا می کند • الگوريتم بسيار پيچيده تری بر اثر مجموعه رفتارهای مورچه ها اجرا می شود

  10. Swarm Intelligence • Swarm Intelligence يا هوش جمعی تعامل جزئی تعداد زيادی عوامل ساده برای حصول یک هدف کلی است • خصوصيات هوش جمعی عبارتند از: • عوامل ساده اند • عوامل به صورت غيرمستقيم با هم ارتباط برقرار می کنند • رفتار کلی پيچیده از رفتارهای جزئی ساده عوامل حاصل می شود • این رفتارها پايدارند • تک تک عوامل در حصول نتيجه کلی بی تاثيرند

  11. مثال: تميزکاری لانه مورچه ها • مورچه ها آشغال ها ویا غذای پراکنده درسطح لانه را جمع آوری و در یک یا چند جا کپه می کنند • اين کار به اين ترتيب عملی می شود: • هر مورچه شروع به گردش به صورت دلخواه و بی هدف در سطح لانه می کند • اگر مورچه به یک تکه آشغال برخورد کرد آن را بر می دارد • مورچه به گردش تصادفی خود ادامه می دهد • اگر مورچه به يک تکه آشغال ديگررسید تکه قبلی را در کنار آن قرار می دهد • و باز به گردش خود ادامه می دهد • بعد از مدتی مشاهده می شود که آشغال ها در گوشه کنار لانه کپه شده اند.

  12. Ant Colony Optimization • Marco Dorigo is research director of the IRIDIA lab at the Université Libre de Bruxelles • Inspired by the remarkable ability of social insects to solve problems, Dorigo and Stützle introduce new technological design principles for seeking optimized solutions to difficult real-world problems, such as network routing and task scheduling.

  13. Ant Colony Optimization • Ant Colony Optimization از قابليت مورچه ها برای پيدا کردن مسيرهای کوتاه یا کوتاه ترين مسيرها برای مسيريابی در شبکه استفاده می کند

  14. مورچه ها چگونه می توانند کوتاه ترين مسير را پيدا کنند ؟

  15. چگونه مورچه ها ارتباط برقرار می کنند • مورچه ها توانايی ديدن و شنيدن را ندارند و فقط از حس بويايی استفاده می کنند • مورچه ها صدا نيز ندارند • به اين ترتيب مورچه ها نمی توانند با صدا و شنيدن با هم ارتباط ایجاد کنند • ولی با استفاده از حس بويايی می توانند اطلاعات را منتقل کنند • اين نوع ارتباط را “stigmergy” می گويند: • مورچه ها از خود موادی را به جا می گذارند که بوی خاصی دارند • به این مواد pheromone گفته می شود • مورچه ها pheromone به جا مانده از ساير مورچه ها را حس می کنند • علاوه براین مورچه ها شدت بوی pheromone را نيز تشخيص می دهند

  16. Nest Food The Shortest Path (1) • Two ants start their random walk • They both eventually find the food • The one taking the shorter path finds the food first • Each ant leaves a trail of pheromones behind • Once taken the food the ants follow their pheromone trail towards the nest

  17. Nest Food The Shortest Path (2) • The one taken the shorter path returns first and arrives back to the nest first

  18. Nest Food The Shortest Path (3) • Now a third ants wants to search for food • The ant realizes the trials left behind by its predecessors • Most likely it follows one of the existing trials rather than initiating a new trial • Most likely it follows the trial with the higher density of pheromones

  19. Nest Food The Shortest Path (4) • This results in even denser pheromone trial on the shorter path • In long term this results in most ants using the shortest path

  20. Simple Stochastic Algorithm • وقتی يک مورچه شروع به حرکت می کند: • با احتمال کوچکی یک مسير جديد را شروع می کند. • با احتمال بيشتری يکی از مسيرهای موجود دارای pheromone را انتخاب می کند. • ولی در انتخاب مسيرهای موجود هر چه شدت pheromone يک مسيربيشتر باشد احتمال انتخاب آن نيز بالاتر خواهد بود.

  21. چرا مسيرهای تازه؟ • مورچه های قبلی الزاما کوتاه ترين مسيررا انتخاب نکرده اند • انتخاب مسيرهای جديد می تواند منجر به يافتن مسيرهای کوتاه تر بشود • در نهايت اين منتهی به يافتن کوتاه ترين مسير می شود

  22. pheromone تبخير و محو تدريجی • Pheromone به تدريج تبخير می شود. • اين یکی از ضروريات پويا بودن الگوريتم است. • انتقال از مسيرهای کوتاه به مسيرهای کوتاه تر بدون تبخير pheromone در مسيرهای قديمی امکان پذير نخواهد بود.

  23. الگوريتم وفقی • الگوريتم به صورت وفقی عمل می کند. • علت اين امر احتمال شروع مسيرهای تازه و تبخیر تدريجی در مسيرهای قبلی است.

  24. مقابله با خرابی و تغييرات مسير • الگوريتم به دليل رفتار پويا و وفقی می تواند در صورت وقوع خرابی در مسير با يافتن مسير جايگزين با آن مقابله کند. • همچنين اگر تغيير در مسير ايجاد شود الگوريتم خود را با تغييرات هماهنگ می کند. • برای مثال اگر سنگی در مسير مورچه ها قرار داده شود مورچه ها آن را دور زده و مسير کوتاه جديدی را در کنار آن پيدا می کنند. *Disclaimer: May not work with a cube of ice

  25. اثر جانبی • مورچه ها در بین غذاهای موجود در محيط اطراف لانه ابتدا نزديک ترين آنها را منتقل می کنند. • اين یک اثر جانبی الگوريتم است • اين پديده می تواند کاربردهای زيادی داشته باشد

  26. StarLogo • http://education.mit.edu/starlogo/ • StarLogo is a programmable modeling environment for exploring the behaviors of decentralized systems, such as ant colonies. • In decentralized systems, orderly patterns can arise without centralized control. • Increasingly, researchers are choosing decentralized models for the organizations and technologies that they construct in the world, and for the theories that they construct about the world. • StarLogo visualizes the behavior of the decentralized system

  27. StarLogo • StarLogo consists of graphic turtles and an environment • The behavior of the turtles can be programmed • All turtles run the same program in parallel • A turtle can represent almost any type of object: an ant in a colony, a car in a traffic jam, an antibody in an immune system, a molecule in a gas • Also the effect of the environment on turtles can be programmed • You can write programs for thousands of "patches" that make up the turtles' environment. • Turtles and patches can interact with one another • Turtles can be programmed to "sniff" around the environment, and change their behaviors based on what they sense in the patches

  28. Modeling the Ants Behavior DEMO Don’t go away We will continue after the demo

  29. Part 2Ants in Networks

  30. History • ABC routing (Schoonderwoerd et al., 96) • Regular and Uniform ant routing (Subramanian et al., 97) • Antnet (Dorigo et al., 98) • Antnet++ (Dorigo et al., 02) • Improved Antnet (Boyan et al., 02) • Modified Antnet(Tekiner et al., 04) • Antnet with evaporation(Tekiner et al., 04) • Ants algorithm with QoS (Carrillo et al., 04)

  31. What Are Ants • Ants are emulated by mobile agents • Mobile agents are carried by packets • Especial packets can be used as mobile agents (ants) • initialize_ant () • while (current_state  target_state) • A = read_local_pheromone-table() • P = compute_transition_probabilities (A, M, problem_constraints) • next_state = apply_ant_decision_policy (P, problem_constraints) • move_to_next_state (next_state) • if (step-by-step_pheromone_update) • update_pheromone_table() // deposit pheromone on visited arc • update_ant_memory() • if (delayed_pheromone_update) • evaluate_solution() • update_pheromone_tables() // deposit pheromone on ALL visited arcs • die()

  32. What About Pheromones? • Pheromones pass the information about the length of the path (time) to other ants • The agents can pass the same information to data packets at the nodes • Ants decide based on the density of the pheromones and some probability values • The probability values can be calculated based on the path information and listed in routing tables in the nodes

  33. AntNet • First application of ants algorithm for routing in (datagram) packet networks • Ants are sent between source-destination pairs to create a test and feedback signal system • Ants discover and maintain routes • Inter-node trip times are used to adjust next-hop probabilities • Packets are forwarded based on next-hop probabilities

  34. Routing Table • Start with a static routing table for each node. • Each routing table stores the probabilities of using the next hops to reach all possible destinations • Sum of probabilities at each row equals one Ports (Neighboring Nodes) Destinations

  35. Routing Table Updates • To create a dynamic routing table, create “ants” as agents that will go back and forth to random destinations. • These ants will then update the probabilities in the routing table. • Packets will be transferred to paths based on the probabilities listed in the routing table

  36. Out[ ] Buffer Port1 Scheduler FIFO1 FIFO2 Port2 Scheduler FIFO1 FIFO2 Port N Scheduler FIFO1 FIFO2 The Agents • Two types of agents (ants): • Forward Ants (to collect information) • Backward Ants (to update probability table) • Two types of queues: • Low priority queue (data packets and forward ants) • High priority queue (backward ants) • Forward ants are routed at the same priority as data packets • Forward Ants experience the same congestion and delay as data • Backward ants are routed with higher priority than other packets

  37. Forward Ants • At regular intervals every node creates a forward ant to randomly selected destinations. • Destinations are selected to match current traffic patterns • Forward ant uses probabilistic routing tables at every intermediate node to choose output port from unvisited list of nodes. • Elapsed time and node identifier is pushed to ant’s stack. • If a cycle is detected , cycle is deleted from ant’s memory. • When a forward ant reaches to its destination It transforms itself to a backward ant

  38. Backward Ants • A backward ant visits the list of the nodes in its stack in a reverse order, • Updates corresponding entries in the routing tables and array on its way back to source by using its values stored on its stack.

  39. Example

  40. Statistics • Except for the routing table, each node also keeps a table with records of the mean and variance of the trip time to every destination • At each node, backward ants update the trip time statistics to the destination in addition to the next-hop probability

  41. Routing Table Updates • Reinforcement Factor (Based on the trip time and the statistics) r = f (1 - Wbest/T) + g (mean,var) 0 < r < 1, • Increase the probability of the channel that backward ant comes from P’ = P + r * (1 - P) = P * (1 – r) + r • Decrease the probability of the other channels P’ = P * (1 - r)

  42. Data Packets • Data packets are routed using the next-hop probabilities • The packets are distributed over the paths proportional to their probabilities • A probability threshold level can be used to avoid selection of not-so-good paths • Achieve some degree of load balancing over all existing good paths

  43. Performance • AntNet reports better performance in terms of: • Delay • Throughput • Robustness • Reaction to changes • Traffic overhead is higher than OSPF

  44. Variations • Different varieties of the antnet routing algorithm will be resulted depending on the: • Forward ant routing mechanism • Routing table update mechanism • Packet forwarding criterion

  45. Out[ ] Buffer Lookup and forwarding Forward_ANT Port1 Scheduler FIFO1 Data Packet FIFO2 Port2 Scheduler FIFO1 FIFO2 Backward_ANT Updating Port N Scheduler FIFO1 FIFO2 Router Architecture

  46. Evaporation • Link usage statistics are used to evaporate the pheromone laid by the ants. • It is the proportion of number of forward ants destined to the node x over the total ants received by the current node in the given time window. • By evaporating the links probabilities in a predefined rate, average delay experienced per packet is reduced “Improved antnet routing algorithm with link probability evaporation” F. Tekiner, F. Z. Gassemlooy, and S. Al-Khayatt

  47. Congestion • Agents are delayed if congestion occurs • Has the same effect of a longer path • Pheromones evaporate more • Less pheromone if agent is delayed more

  48. Quality of Service • M-Class ants are used for M-class type of services • Probabilities in the routing table represent the probability that packets can reach the required level of QoS • The probabilities are updated based on the delay statistics per QoS class and the available bandwidth • Considering other QoS parameters, such as availability etc., can be studied “A Quality of Service Routing Scheme for Packet Switched Networks based on Ant Colony Behavior ” Liliana Carrillo and J.L. Marzo

  49. Security Issues • Threats • Untrustworthy hosts • Forward data/ant packets to a wrong direction • Delay data packets • Generate bursts of ant packets • Malicious Agents • Carry false trip time information • Attack Goals • Increase the packet latency • Mislead packets to a longer path • Break down a critical node • Mislead packets to a certain node to overload it • Drop Data Packets • Mislead packets to a malicious node “Security Issues in Ant Routing” Weilin Zhong

More Related