Presentation is loading. Please wait.

Presentation is loading. Please wait.

Swarms and Distributed Computing Dennis Shasha. Swarm Intelligence -- examples Given two paths of different lengths, ants will discover the path of shortest.

Similar presentations


Presentation on theme: "Swarms and Distributed Computing Dennis Shasha. Swarm Intelligence -- examples Given two paths of different lengths, ants will discover the path of shortest."— Presentation transcript:

1 Swarms and Distributed Computing Dennis Shasha

2 Swarm Intelligence -- examples Given two paths of different lengths, ants will discover the path of shortest length. Given a product, no matter how complex, free competition will lead to fair prices. Adam Smith’s invisible hand. People group together to form cultures (e.g. always cooperate in one; always compete in another).

3 Swarm Intelligence -- requires flexibility Place a bunch of flies in a jar, lay the jar so its bottom is facing an open window, then open the lid. –Flies will bump around randomly then fly out the lid side, find the open window and leave. –Bees will continually try to go out the bottom and will eventually die.

4 Swarm Intelligence -- requires willingness to explore Place a bunch of flies in a jar, lay the jar so its bottom is facing an open window, then open the lid. –Flies will bump around randomly then fly out the lid side, find the open window and leave. –Bees will continually try to go out the bottom and will eventually die. Note: This is in fact a property of intelligence and applies to individual flies/bees as well.

5 Swarm Intelligence -- requires learning from others Evolution works quite slowly. One species may evolve a new degree of freedom in a limb. Human development is perhaps a million times faster, e.g. in 100 years a species that can’t jump that high flies at orbital velocities. “Memes” (ideas) spread essentially instantly. Improvements are rapid.

6 Stigmergy: how do ants learn from one another Stigmergy is what happens when work changes the environment. Thus, work becomes the external energy. An ant, essentially blind, knows how to explore randomly follow smells (pheromones) left by itself or others

7 Finding the shortest path to food Nest food Ant A Ant B

8 Ant B discovers food Nest food Ant A Ant B

9 Ant A discovers food Ant B follows pheromones home Nest food Ant A Ant B

10 Ants C and D follow B’s pheromones (shorter path) Nest food Ant A Ant C, Ant D

11 What Accomplished Blind ants are able to “follow their noses” to find an optimal path. They communicate by scent (pheromones). Randomness followed by “positive feedback” or amplification, because C and D will now lay down their own pheromones.

12 What if Lower Path is blocked (perhaps later)? Nest food Weak pheromones Ants X, Y, Z Barrier Strong pheromones

13 Ants retrace steps Nest food Weak pheromones Ants X, Y, Z Barrier Strong pheromones

14 Ants follow weaker pheromones Nest food Weak pheromones Ants X, Y, Z Barrier Strong pheromones

15 Weak become strong through repeated use and pheromones Nest food Strong pheromones More ants Barrier Weak pheromones

16 Simple rules create intelligent designs Random exploration. Communication through scents (stigmergy) Positive feedback to establish preferred route. Adaptation to changing conditions. No complaining, no explaining.

17 Cool story but can we use it? Consider a communication network in which links appear and disappear over the course of hours. If A wants to communicate with B, A might send out “ant” tokens that try to find B, retrace their steps and announce their length. Communication takes place along shortest path. Longer paths can still be used if there is a break in a link. May want continuous exploration.

18 Task Allocation in a Swarm Seed harvester ants need to carry food back to their nest. Ants pass food down a chain. Ant carries food down the chain until it reaches the next ant. Transfers and then returns for more. “Bucket Brigade”

19 Typical state of the ants: D gets more food, gives to C, B returns to get more from C. nest food Ant A Ant B Ant CAnt D

20 Benefits of bucket brigade Geometrically efficient – can work in a very narrow setting. Robust to failure – if an ant drops out, other ants can pick up the slack without changing the protocol. Robust to differences in speed – if three ants B, C, D are in a row and C is slowest, then B and D will end up walking farther again without changing protocol.

21 Warehouse tasking Worker 1Worker 2Worker 3…. Orders can come in anywhere

22 Organization 1: zones for stocking and delivery Worker k is responsible for all goods in zone k. When an order comes in for zone k, worker k takes the appropriate good to the exit. When several orders enter concurrently, there might be traffic jams at the exit.

23 Organization 2: zone for stocking bucket brigade for delivery Worker k is responsible for all goods in zone k. When an order comes in for zone k, worker k takes the appropriate good towards the exit until he meets worker k-1 and then transfers. Worker k-1 goes towards k-2 and does transfer.

24 Which is better? Assuming no traffic jams, for which order traffic would zone delivery be better? For which ones would bucket brigade be better? What if there is some cost to transfer? What if you could anticipate the traffic?

25 Which is more flexible? Worker gets hurt. Worker is slower than others. Worker is more lazy than others. Where should the fast workers go?

26 Office workflow: claims management Gatekeeper routes to specialists. Specialists route to one another. Does this function well for such work?

27 Bucket Brigade for Offices What if a specialist is missing? –Have pools of interchangeable specialists What about a global view of the customer? –Really need good computer support, e.g. has this customer been well treated in the past? Is this customer possibly exercising fraud? Are the incentives consistent with customer service? –Keep a notion of global response time.

28 Tie-breaking by Swarms A group of ants want to sort different sized youngsters: microlarvae, macrolarvae, pupae. At first they are not sorted, but there are, by chance, local concentrations of one type or the other. What local algorithm could each ant use to concentrate the different youngster types in uniform clusters?

29 Tie-breaking Protocol Move youngster type to location where there are a lot of youngsters of that type. Apparently this can be done entirely by smell. Lesson for computer science? Certainly not if global information is available. Bucket sort vs. quicksort But intriguing and very parallel.

30 Tropical Termites and the Arch Colonies of tropical termites will build domes (i.e. intersecting arches). Doing this with humans requires centralized control and synchronization. Termites build pillars and then the pillars fall towards one another. How?

31 Incredibly Simple Rules Go towards strongest scent. Drop dirt there. Ant will find the two towers equally strong. They will choose one but will tend to go towards the inside of that tower. That’s why the towers fall towards one another. No synchronization because random and many. (Bacterial fried eggs.)

32 References so far E. Bonabeau and G. Theraulaz, "Swarm smarts", Scientific American, pp , March E. Bonabeau, C. W. Hunt, P. Gaudiano “Agent-Based Modeling for Testing and Designing Novel Decentralized Command and Control System Paradigms” July 2003

33 Is there a theory to all this? Not really. There seem to be useful analogies and some simulation software available from the Santa Fe institute. A true theory would need to explain altruism in a swarm (why does an ant/bee/soldier sacrifice for the sake of the whole). Most individuals in species show altruism when genes are held in common.

34 Pareto Optima Model Suppose you have two objectives in life: money and location. You can get paid more in city X but you prefer city Y. So, there is a tradeoff: you can move from X to Y but only after losing some money. So, (X, $1 million) may be traded for (Y, $500,000) “The improvement of one objective function value comes only at the cost of worsening some other objective function value.” So each of above is Pareto optimum.

35 Nash Equilibrium Model Suppose you are playing a multi-player game. If no single person can improve his/her lot by changing strategies, then the game is in Nash equilibrium.

36 Nash vs. Pareto Consider prisoner’s dilemma: Bob and Alice are prisoners. If they protect one another, they get little punishment (value -2). If one blames the other and the other protects the first then blamer goes free (value 0) and blamee gets more prison (value -4). If they both blame one another, they both suffer more punishment (value -3).

37 Nash vs. Pareto II For Pareto, the state in which they both protect one another is a Pareto optimum because leaving that state would hurt the other player. For Nash, the mutual protection state is not an equilibrium because either wins more by blaming.

38 Nash vs. Pareto markets vs. societies Nash models markets. All agents act selfishly. Free market is efficient. It also models cheating (if I cut the line and you don’t, I win; so we all end up cutting). That is inefficient. Pareto models very stable bureaucracies (and friendly academic departments). Nobody hurts anyone else. Swarms can take on both characteristics.

39 Pareto Optima Model Question: how can a bunch of swarm elements each with a local Pareto optimum achieve a global Pareto optimum? It does work in perfect markets. Where else? Ref: “Foundations of Swarm Intelligence: From Principles to Practice” Mark Fleischer

40 Culture and Game Theory “Culture can be defined as individual and community level behavioral patterns that depend upon context and are often suboptimal.” Game theory is about players, each trying to optimize. In some games, cooperation brings more profit to individuals than competition. In other games, the reverse.

41 “Looking out for number 1” vs “We are all in this together” Suppose a group of people are farmers. When a new couple needs a home, the whole community raises a barn. Equipment is shared, etc. How are such people going to act if they see someone in need? Ask the same question if the people are a collection of day traders (or fishermen).

42 How to model this Intra-individual consistency: you are not selfish once and altruistic another time. Inter-agent consistency: you act like your neighbors. Behavioral stickiness: individuals do not alter their behavior despite changes to their incentives. Ref: “Can Game Theory Explain Culture? The Emergence of Cultural Behavior Within Multiple Games” Jenna Bednar and Scott Page


Download ppt "Swarms and Distributed Computing Dennis Shasha. Swarm Intelligence -- examples Given two paths of different lengths, ants will discover the path of shortest."

Similar presentations


Ads by Google