SlideShare a Scribd company logo
Artificial Intelligence
Solving problems by searching
            Fall 2008

     professor: Luigi Ceccaroni
Problem solving
• We want:
  – To automatically solve a problem


• We need:
  – A representation of the problem
  – Algorithms that use some strategy to solve
    the problem defined in that representation
Problem representation
• General:
  – State space: a problem is divided into a set
    of resolution steps from the initial state to the
    goal state
  – Reduction to sub-problems: a problem is
    arranged into a hierarchy of sub-problems
• Specific:
  – Game resolution
  – Constraints satisfaction
States
• A problem is defined by its elements and their
  relations.
• In each instant of the resolution of a problem,
  those elements have specific descriptors (How
  to select them?) and relations.
• A state is a representation of those elements in
  a given moment.
• Two special states are defined:
  – Initial state (starting point)
  – Final state (goal state)
State modification:
           successor function
• A successor function is needed to move
  between different states.
• A successor function is a description of
  possible actions, a set of operators. It is a
  transformation function on a state
  representation, which convert it into another
  state.
• The successor function defines a relation of
  accessibility among states.
• Representation of the successor function:
  – Conditions of applicability
  – Transformation function
State space
• The state space is the set of all states
  reachable from the initial state.
• It forms a graph (or map) in which the nodes are
  states and the arcs between nodes are actions.
• A path in the state space is a sequence of
  states connected by a sequence of actions.
• The solution of the problem is part of the map
  formed by the state space.
Problem solution
• A solution in the state space is a path from the
  initial state to a goal state or, sometimes, just a
  goal state.
• Path/solution cost: function that assigns a
  numeric cost to each path, the cost of applying
  the operators to the states
• Solution quality is measured by the path cost
  function, and an optimal solution has the
  lowest path cost among all solutions.
• Solutions: any, an optimal one, all. Cost is
  important depending on the problem and the
  type of solution sought.
Problem description
• Components:
  – State space (explicitly or implicitly defined)
  – Initial state
  – Goal state (or the conditions it has to fulfill)
  – Available actions (operators to change state)
  – Restrictions (e.g., cost)
  – Elements of the domain which are relevant to the
    problem (e.g., incomplete knowledge of the starting
    point)
  – Type of solution:
      • Sequence of operators or goal state
      • Any, an optimal one (cost definition needed), all
Example: 8-puzzle


   1    2   3

    4   5   6

    7   8
Example: 8-puzzle
• State space: configuration of the eight
  tiles on the board
• Initial state: any configuration
• Goal state: tiles in a specific order
• Operators or actions: “blank moves”
  – Condition: the move is within the board
  – Transformation: blank moves Left, Right, Up,
    or Down
• Solution: optimal sequence of operators
Example: n queens
  (n = 4, n = 8)
Example: n queens
               (n = 4, n = 8)
• State space: configurations from 0 to n queens
  on the board with only one queen per row and
  column
• Initial state: configuration without queens on the
  board
• Goal state: configuration with n queens such that
  no queen attacks any other
• Operators or actions: place a queen on the
  board
      Condition: the new queen is not attacked by any
       other already placed
      Transformation: place a new queen in a particular
       square of the board
• Solution: one solution (cost is not considered)
Structure of the state space
• Data structures:
  – Trees: only one path to a given node
  – Graphs: several paths to a given node
• Operators: directed arcs between nodes
• The search process explores the state
  space.
• In the worst case all possible paths
  between the initial state and the goal state
  are explored.
Search as goal satisfaction
• Satisfying a goal
  – Agent knows what the goal is
  – Agent cannot evaluate intermediate solutions
    (uninformed)
  – The environment is:
     • Static
     • Observable
     • Deterministic
Example: holiday in Romania
• On holiday in Romania; currently in Arad
• Flight leaves tomorrow from Bucharest at
  13:00
• Let’s configure this to be an AI problem
Romania
• What’s the problem?
  – Accomplish a goal
    • Reach Bucharest by 13:00




• So this is a goal-based problem
Romania
• What’s an example of a non-goal-based
  problem?
  – Live long and prosper
  – Maximize the happiness of your trip to
    Romania
  – Don’t get hurt too much
Romania
• What qualifies as a solution?
  – You can/cannot reach Bucharest by 13:00
  – The actions one takes to travel from Arad to
    Bucharest along the shortest (in time) path
Romania
• What additional information does one
  need?
  – A map
More concrete problem
            definition
                             Which cities could you be
          A state space      in?
                             Which city do you start
          An initial state   from?
                             Which city do you aim to
            A goal state     reach?
                             When in city foo, the
A function defining state    following cities can be
              transitions    reached
 A function defining the     How long does it take to
        “cost” of a state    travel through a city
                             sequence?
              sequence
More concrete problem
                  definition
                    A state space      Choose a representation

                                       Choose an element from the
                    An initial state   representation
                                       Create goal_function(state) such
                      A goal state     that TRUE is returned upon reaching
                                       goal
                                       successor_function(statei) =
         A function defining state
                                       {<actiona, statea>, <actionb, stateb>,
                       transitions     …}

A function defining the “cost” of a
                                       cost (sequence) = number
                  state sequence
Important notes about this
          example
– Static environment (available states,
  successor function, and cost functions don’t
  change)
– Observable (the agent knows where it is)
– Discrete (the actions are discrete)
– Deterministic (successor function is always
  the same)
Tree search algorithms
• Basic idea:
  – Simulated
    exploration of
    state space by
    generating
    successors of
    already explored
    states (AKA
    expanding
    states)            Sweep out from start (breadth)
Tree search algorithms
• Basic idea:
  – Simulated
    exploration of
    state space by
    generating
    successors of
    already explored
    states (AKA
    expanding          Go East, young man! (depth)
    states)
Implementation: general search
          algorithm
Algorithm General Search
 Open_states.insert (Initial_state)
 Current= Open_states.first()
  while not is_final?(Current) and not Open_states.empty?() do
   Open_states.delete_first()
   Closed_states.insert(Current)
   Successors= generate_successors(Current)
   Successors= process_repeated(Successors, Closed_states,
      Open_states)
   Open_states.insert(Successors)
   Current= Open_states.first()
  eWhile
eAlgorithm
Example: Arad  Bucharest
Algorithm General Search
 Open_states.insert (Initial_state)




                      Arad
Example: Arad  Bucharest
• Current= Open_states.first()




                     Arad
Example: Arad  Bucharest
while not is_final?(Current) and not Open_states.empty?() do
   Open_states.delete_first()
   Closed_states.insert(Current)
   Successors= generate_successors(Current)
   Successors= process_repeated(Successors, Closed_states,
      Open_states)
   Open_states.insert(Successors)


                                     Arad




                 Zerind (75)    Timisoara (118)   Sibiu (140)
Example: Arad  Bucharest
• Current= Open_states.first()




                              Arad




           Zerind (75)   Timisoara (118)   Sibiu (140)
Example: Arad  Bucharest
while not is_final?(Current) and not Open_states.empty?() do
   Open_states.delete_first()
   Closed_states.insert(Current)
   Successors= generate_successors(Current)
   Successors= process_repeated(Successors, Closed_states,
      Open_states)
   Open_states.insert(Successors)


                                                   Arad




               Zerind (75)       Timisoara (118)          Sibiu (140)




                             Dradea (151)             Faragas (99)      Rimnicu Vilcea (80)
Implementation: states vs.
            nodes
• State
  – (Representation of) a physical configuration
• Node
  – Data structure constituting part of a search
    tree
     • Includes parent, children, depth, path cost g(x)
• States do not have parents, children,
  depth, or path cost!
Search strategies
• A strategy is defined by picking the order of node
  expansion
• Strategies are evaluated along the following
  dimensions:
   – Completeness – does it always find a solution if
     one exists?
   – Time complexity – number of nodes
     generated/expanded
   – Space complexity – maximum nodes in memory
   – Optimality – does it always find a least-cost
     solution?
Search strategies
• Time and space complexity are measured in
  terms of:
   – b – maximum branching factor of the search tree
     (may be infinite)
   – d – depth of the least-cost solution
   – m – maximum depth of the state space (may be
     infinite)
Uninformed Search Strategies
• Uninformed strategies use only the
  information available in the problem
  definition
  –   Breadth-first search
  –   Uniform-cost search
  –   Depth-first search
  –   Depth-limited search
  –   Iterative deepening search
Nodes
• Open nodes:
  – Generated, but not yet explored
  – Explored, but not yet expanded


• Closed nodes:
  – Explored and expanded



                                      35
Breadth-first search
• Expand shallowest unexpanded node
• Implementation:
  – A FIFO queue, i.e., new successors go at end
Space cost of BFS




• Because you must be able to generate the path upon
  finding the goal state, all visited nodes must be stored
• O (bd+1)
Properties of breadth-first
                search
• Complete?
   – Yes (if b (max branch factor) is finite)
• Time?
   – 1 + b + b2 + … + bd + b(bd-1) = O(bd+1), i.e., exponential in d
• Space?
   – O(bd+1) (keeps every node in memory)
• Optimal?
   – Only if cost = 1 per step, otherwise not optimal in general
• Space is the big problem; it can easily generate nodes at
  10 MB/s, so 24 hrs = 860GB!
Depth-first search
• Expand deepest unexpanded node
• Implementation:
  – A LIFO queue, i.e., a stack
Depth-first search
•   Complete?
    –   No: fails in infinite-depth spaces, spaces with loops.
    –   Can be modified to avoid repeated states along path 
        complete in finite spaces
•   Time?
    –   O(bm): terrible if m is much larger than d, but if solutions are
        dense, may be much faster than breadth-first
•   Space?
    –   O(bm), i.e., linear space!
•   Optimal?
    –   No
Depth-limited search
• It is depth-first search with an imposed
  limit on the depth of exploration, to
  guarantee that the algorithm ends.




                                        41
Treatment of repeated states
• Breadth-first:
   – If the repeated state is in the structure of closed or open
     nodes, the actual path has equal or greater depth than the
     repeated state and can be forgotten.




                                                          42
Treatment of repeated states
• Depth-first:
   – If the repeated state is in the structure of closed nodes, the
     actual path is kept if its depth is less than the repeated state.
   – If the repeated state is in the structure of open nodes, the
     actual path has always greater depth than the repeated state
     and can be forgotten.




                                                             43
Iterative deepening search
Iterative deepening search
• The algorithm consists of iterative, depth-first
  searches, with a maximum depth that increases at
  each iteration. Maximum depth at the beginning is 1.
• Behavior similar to BFS, but without the spatial
  complexity.
• Only the actual path is kept in memory; nodes are
  regenerated at each iteration.
• DFS problems related to infinite branches are
  avoided.
• To guarantee that the algorithm ends if there is no
  solution, a general maximum depth of exploration can
  be defined.                                      45
Iterative deepening search
Summary
– All uninformed searching techniques are more alike
  than different.
– Breadth-first has space issues, and possibly optimality
  issues.
– Depth-first has time and optimality issues, and possibly
  completeness issues.
– Depth-limited search has optimality and completeness
  issues.
– Iterative deepening is the best uninformed search we
  have explored.
Uninformed vs. informed
• Blind (or uninformed) search algorithms:
  – Solution cost is not taken into account.


• Heuristic (or informed) search algorithms:
  – A solution cost estimation is used to guide the
    search.
  – The optimal solution, or even a solution, are
    not guaranteed.

                                               48

More Related Content

What's hot

I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
vikas dhakane
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
Megha Sharma
 
Agents in Artificial intelligence
Agents in Artificial intelligence Agents in Artificial intelligence
Agents in Artificial intelligence
Lalit Birla
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
FellowBuddy.com
 
Production System in AI
Production System in AIProduction System in AI
Production System in AI
Bharat Bhushan
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AIVishal Singh
 
Popular search algorithms
Popular search algorithmsPopular search algorithms
Popular search algorithms
Minakshi Atre
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
DataminingTools Inc
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
Amar Jukuntla
 
search strategies in artificial intelligence
search strategies in artificial intelligencesearch strategies in artificial intelligence
search strategies in artificial intelligence
Hanif Ullah (Gold Medalist)
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
karthikaparthasarath
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)
Bablu Shofi
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
vikas dhakane
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms
Syed Ahmed
 
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdfUNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
JenishaR1
 
Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.ppt
arunsingh660
 
Search problems in Artificial Intelligence
Search problems in Artificial IntelligenceSearch problems in Artificial Intelligence
Search problems in Artificial Intelligence
ananth
 
Problem Formulation in Artificial Inteligence Projects
Problem Formulation in Artificial Inteligence ProjectsProblem Formulation in Artificial Inteligence Projects
Problem Formulation in Artificial Inteligence Projects
Dr. C.V. Suresh Babu
 

What's hot (20)

I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
 
Agents in Artificial intelligence
Agents in Artificial intelligence Agents in Artificial intelligence
Agents in Artificial intelligence
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
Production System in AI
Production System in AIProduction System in AI
Production System in AI
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
 
Hill climbing
Hill climbingHill climbing
Hill climbing
 
Popular search algorithms
Popular search algorithmsPopular search algorithms
Popular search algorithms
 
AI: AI & Problem Solving
AI: AI & Problem SolvingAI: AI & Problem Solving
AI: AI & Problem Solving
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
 
search strategies in artificial intelligence
search strategies in artificial intelligencesearch strategies in artificial intelligence
search strategies in artificial intelligence
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
 
Informed search (heuristics)
Informed search (heuristics)Informed search (heuristics)
Informed search (heuristics)
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
Artificial Intelligence -- Search Algorithms
Artificial Intelligence-- Search Algorithms Artificial Intelligence-- Search Algorithms
Artificial Intelligence -- Search Algorithms
 
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdfUNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
 
Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.ppt
 
Search problems in Artificial Intelligence
Search problems in Artificial IntelligenceSearch problems in Artificial Intelligence
Search problems in Artificial Intelligence
 
Planning
Planning Planning
Planning
 
Problem Formulation in Artificial Inteligence Projects
Problem Formulation in Artificial Inteligence ProjectsProblem Formulation in Artificial Inteligence Projects
Problem Formulation in Artificial Inteligence Projects
 

Similar to Solving problems by searching

Artificial intelligence(04)
Artificial intelligence(04)Artificial intelligence(04)
Artificial intelligence(04)
Nazir Ahmed
 
Lecture 3 problem solving
Lecture 3   problem solvingLecture 3   problem solving
Lecture 3 problem solving
Vajira Thambawita
 
l2.pptx
l2.pptxl2.pptx
l2.pptx
l2.pptxl2.pptx
Lec#2
Lec#2Lec#2
Lec#2
Ali Shah
 
CH2_AI_Lecture1.ppt
CH2_AI_Lecture1.pptCH2_AI_Lecture1.ppt
CH2_AI_Lecture1.ppt
AhmedNURHUSIEN
 
3 probsolver edited.ppt
3 probsolver edited.ppt3 probsolver edited.ppt
3 probsolver edited.ppt
HenokGetachew15
 
Lecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptxLecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptx
AndrewKuziwakwasheMu
 
Problem Solving Agents decide what to do by finding a sequence of actions tha...
Problem Solving Agents decide what to do by finding a sequence of actions tha...Problem Solving Agents decide what to do by finding a sequence of actions tha...
Problem Solving Agents decide what to do by finding a sequence of actions tha...
KrishnaVeni451953
 
Lecture is related to the topic of Artificial intelligence
Lecture is related to the topic of Artificial intelligenceLecture is related to the topic of Artificial intelligence
Lecture is related to the topic of Artificial intelligence
mohsinwaseer1
 
CptS 440 / 540 Artificial Intelligence
CptS 440 / 540 Artificial IntelligenceCptS 440 / 540 Artificial Intelligence
CptS 440 / 540 Artificial Intelligencebutest
 
ProblemSolving(L-2).pdf
ProblemSolving(L-2).pdfProblemSolving(L-2).pdf
ProblemSolving(L-2).pdf
AQSA SHAHID
 
Search-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdfSearch-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdf
MrRRThirrunavukkaras
 
Jarrar: Un-informed Search
Jarrar: Un-informed SearchJarrar: Un-informed Search
Jarrar: Un-informed Search
Mustafa Jarrar
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
HamzaJaved64
 
state-spaces29Sep06.ppt
state-spaces29Sep06.pptstate-spaces29Sep06.ppt
state-spaces29Sep06.ppt
PerumalPitchandi
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
kitsenthilkumarcse
 
Reinfrocement Learning
Reinfrocement LearningReinfrocement Learning
Reinfrocement Learning
Natan Katz
 
Artificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-searchArtificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-search
Taymoor Nazmy
 

Similar to Solving problems by searching (20)

Artificial intelligence(04)
Artificial intelligence(04)Artificial intelligence(04)
Artificial intelligence(04)
 
Lecture 3 problem solving
Lecture 3   problem solvingLecture 3   problem solving
Lecture 3 problem solving
 
l2.pptx
l2.pptxl2.pptx
l2.pptx
 
l2.pptx
l2.pptxl2.pptx
l2.pptx
 
Lec#2
Lec#2Lec#2
Lec#2
 
CH2_AI_Lecture1.ppt
CH2_AI_Lecture1.pptCH2_AI_Lecture1.ppt
CH2_AI_Lecture1.ppt
 
3 probsolver edited.ppt
3 probsolver edited.ppt3 probsolver edited.ppt
3 probsolver edited.ppt
 
Lecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptxLecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptx
 
Problem Solving Agents decide what to do by finding a sequence of actions tha...
Problem Solving Agents decide what to do by finding a sequence of actions tha...Problem Solving Agents decide what to do by finding a sequence of actions tha...
Problem Solving Agents decide what to do by finding a sequence of actions tha...
 
Lecture is related to the topic of Artificial intelligence
Lecture is related to the topic of Artificial intelligenceLecture is related to the topic of Artificial intelligence
Lecture is related to the topic of Artificial intelligence
 
CptS 440 / 540 Artificial Intelligence
CptS 440 / 540 Artificial IntelligenceCptS 440 / 540 Artificial Intelligence
CptS 440 / 540 Artificial Intelligence
 
ProblemSolving(L-2).pdf
ProblemSolving(L-2).pdfProblemSolving(L-2).pdf
ProblemSolving(L-2).pdf
 
Search-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdfSearch-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdf
 
Searching techniques
Searching techniquesSearching techniques
Searching techniques
 
Jarrar: Un-informed Search
Jarrar: Un-informed SearchJarrar: Un-informed Search
Jarrar: Un-informed Search
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
 
state-spaces29Sep06.ppt
state-spaces29Sep06.pptstate-spaces29Sep06.ppt
state-spaces29Sep06.ppt
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
 
Reinfrocement Learning
Reinfrocement LearningReinfrocement Learning
Reinfrocement Learning
 
Artificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-searchArtificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-search
 

More from Luigi Ceccaroni

Digital twins of the environment: opportunities and barriers for citizen science
Digital twins of the environment: opportunities and barriers for citizen scienceDigital twins of the environment: opportunities and barriers for citizen science
Digital twins of the environment: opportunities and barriers for citizen science
Luigi Ceccaroni
 
Harnessing the power of citizen science for environmental stewardship and wat...
Harnessing the power of citizen science for environmental stewardship and wat...Harnessing the power of citizen science for environmental stewardship and wat...
Harnessing the power of citizen science for environmental stewardship and wat...
Luigi Ceccaroni
 
Citizen science, training, data quality and interoperability
Citizen science, training, data quality and interoperabilityCitizen science, training, data quality and interoperability
Citizen science, training, data quality and interoperability
Luigi Ceccaroni
 
Methods for measuring citizen-science impact
Methods for measuring citizen-science impactMethods for measuring citizen-science impact
Methods for measuring citizen-science impact
Luigi Ceccaroni
 
Abrazo, integra tv 4all @ eweek2004 (final)
Abrazo, integra tv 4all @ eweek2004 (final)Abrazo, integra tv 4all @ eweek2004 (final)
Abrazo, integra tv 4all @ eweek2004 (final)
Luigi Ceccaroni
 
Abrazo @ congreso e learning e inclusión social 2004
Abrazo @ congreso e learning e inclusión social 2004Abrazo @ congreso e learning e inclusión social 2004
Abrazo @ congreso e learning e inclusión social 2004
Luigi Ceccaroni
 
Pizza and a movie 2002 aamas
Pizza and a movie 2002   aamasPizza and a movie 2002   aamas
Pizza and a movie 2002 aamas
Luigi Ceccaroni
 
Integra tv 4all 2005 - drt4all
Integra tv 4all 2005 - drt4allIntegra tv 4all 2005 - drt4all
Integra tv 4all 2005 - drt4all
Luigi Ceccaroni
 
In out pc media center 2003
In out pc media center 2003In out pc media center 2003
In out pc media center 2003
Luigi Ceccaroni
 
Modeling utility ontologies in agentcities with a collaborative approach 2002...
Modeling utility ontologies in agentcities with a collaborative approach 2002...Modeling utility ontologies in agentcities with a collaborative approach 2002...
Modeling utility ontologies in agentcities with a collaborative approach 2002...
Luigi Ceccaroni
 
Pizza and a movie 2002 aamas
Pizza and a movie 2002   aamasPizza and a movie 2002   aamas
Pizza and a movie 2002 aamas
Luigi Ceccaroni
 
The april agent platform 2002 agentcities, lausanne
The april agent platform 2002 agentcities, lausanneThe april agent platform 2002 agentcities, lausanne
The april agent platform 2002 agentcities, lausanne
Luigi Ceccaroni
 
ILIAD and CoCoast @ Noordzeedagen 2021
ILIAD and CoCoast @ Noordzeedagen 2021ILIAD and CoCoast @ Noordzeedagen 2021
ILIAD and CoCoast @ Noordzeedagen 2021
Luigi Ceccaroni
 
MICS @ Geneva 2020
MICS @ Geneva 2020MICS @ Geneva 2020
MICS @ Geneva 2020
Luigi Ceccaroni
 
Metrics and instruments to evaluate the impacts of citizen science
Metrics and instruments to evaluate the impacts of citizen scienceMetrics and instruments to evaluate the impacts of citizen science
Metrics and instruments to evaluate the impacts of citizen science
Luigi Ceccaroni
 
COST Action 15212 WG5 - Standardisation and interoperability
COST Action 15212 WG5 - Standardisation and interoperabilityCOST Action 15212 WG5 - Standardisation and interoperability
COST Action 15212 WG5 - Standardisation and interoperability
Luigi Ceccaroni
 
The role of interoperability in encouraging participation in citizen science ...
The role of interoperability in encouraging participation in citizen science ...The role of interoperability in encouraging participation in citizen science ...
The role of interoperability in encouraging participation in citizen science ...
Luigi Ceccaroni
 
Ontology of citizen science @ Siena 2016 11 24
Ontology of citizen science @ Siena 2016 11 24Ontology of citizen science @ Siena 2016 11 24
Ontology of citizen science @ Siena 2016 11 24
Luigi Ceccaroni
 
Citclops/EyeOnWater @ Barcelona - Citizen science day 2016
Citclops/EyeOnWater @ Barcelona - Citizen science day 2016Citclops/EyeOnWater @ Barcelona - Citizen science day 2016
Citclops/EyeOnWater @ Barcelona - Citizen science day 2016
Luigi Ceccaroni
 
Workshop - data collection and management
Workshop - data collection and managementWorkshop - data collection and management
Workshop - data collection and management
Luigi Ceccaroni
 

More from Luigi Ceccaroni (20)

Digital twins of the environment: opportunities and barriers for citizen science
Digital twins of the environment: opportunities and barriers for citizen scienceDigital twins of the environment: opportunities and barriers for citizen science
Digital twins of the environment: opportunities and barriers for citizen science
 
Harnessing the power of citizen science for environmental stewardship and wat...
Harnessing the power of citizen science for environmental stewardship and wat...Harnessing the power of citizen science for environmental stewardship and wat...
Harnessing the power of citizen science for environmental stewardship and wat...
 
Citizen science, training, data quality and interoperability
Citizen science, training, data quality and interoperabilityCitizen science, training, data quality and interoperability
Citizen science, training, data quality and interoperability
 
Methods for measuring citizen-science impact
Methods for measuring citizen-science impactMethods for measuring citizen-science impact
Methods for measuring citizen-science impact
 
Abrazo, integra tv 4all @ eweek2004 (final)
Abrazo, integra tv 4all @ eweek2004 (final)Abrazo, integra tv 4all @ eweek2004 (final)
Abrazo, integra tv 4all @ eweek2004 (final)
 
Abrazo @ congreso e learning e inclusión social 2004
Abrazo @ congreso e learning e inclusión social 2004Abrazo @ congreso e learning e inclusión social 2004
Abrazo @ congreso e learning e inclusión social 2004
 
Pizza and a movie 2002 aamas
Pizza and a movie 2002   aamasPizza and a movie 2002   aamas
Pizza and a movie 2002 aamas
 
Integra tv 4all 2005 - drt4all
Integra tv 4all 2005 - drt4allIntegra tv 4all 2005 - drt4all
Integra tv 4all 2005 - drt4all
 
In out pc media center 2003
In out pc media center 2003In out pc media center 2003
In out pc media center 2003
 
Modeling utility ontologies in agentcities with a collaborative approach 2002...
Modeling utility ontologies in agentcities with a collaborative approach 2002...Modeling utility ontologies in agentcities with a collaborative approach 2002...
Modeling utility ontologies in agentcities with a collaborative approach 2002...
 
Pizza and a movie 2002 aamas
Pizza and a movie 2002   aamasPizza and a movie 2002   aamas
Pizza and a movie 2002 aamas
 
The april agent platform 2002 agentcities, lausanne
The april agent platform 2002 agentcities, lausanneThe april agent platform 2002 agentcities, lausanne
The april agent platform 2002 agentcities, lausanne
 
ILIAD and CoCoast @ Noordzeedagen 2021
ILIAD and CoCoast @ Noordzeedagen 2021ILIAD and CoCoast @ Noordzeedagen 2021
ILIAD and CoCoast @ Noordzeedagen 2021
 
MICS @ Geneva 2020
MICS @ Geneva 2020MICS @ Geneva 2020
MICS @ Geneva 2020
 
Metrics and instruments to evaluate the impacts of citizen science
Metrics and instruments to evaluate the impacts of citizen scienceMetrics and instruments to evaluate the impacts of citizen science
Metrics and instruments to evaluate the impacts of citizen science
 
COST Action 15212 WG5 - Standardisation and interoperability
COST Action 15212 WG5 - Standardisation and interoperabilityCOST Action 15212 WG5 - Standardisation and interoperability
COST Action 15212 WG5 - Standardisation and interoperability
 
The role of interoperability in encouraging participation in citizen science ...
The role of interoperability in encouraging participation in citizen science ...The role of interoperability in encouraging participation in citizen science ...
The role of interoperability in encouraging participation in citizen science ...
 
Ontology of citizen science @ Siena 2016 11 24
Ontology of citizen science @ Siena 2016 11 24Ontology of citizen science @ Siena 2016 11 24
Ontology of citizen science @ Siena 2016 11 24
 
Citclops/EyeOnWater @ Barcelona - Citizen science day 2016
Citclops/EyeOnWater @ Barcelona - Citizen science day 2016Citclops/EyeOnWater @ Barcelona - Citizen science day 2016
Citclops/EyeOnWater @ Barcelona - Citizen science day 2016
 
Workshop - data collection and management
Workshop - data collection and managementWorkshop - data collection and management
Workshop - data collection and management
 

Recently uploaded

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
Elena Simperl
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
Cheryl Hung
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
Frank van Harmelen
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
Prayukth K V
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 

Recently uploaded (20)

FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*Neuro-symbolic is not enough, we need neuro-*semantic*
Neuro-symbolic is not enough, we need neuro-*semantic*
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 previewState of ICS and IoT Cyber Threat Landscape Report 2024 preview
State of ICS and IoT Cyber Threat Landscape Report 2024 preview
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 

Solving problems by searching

  • 1. Artificial Intelligence Solving problems by searching Fall 2008 professor: Luigi Ceccaroni
  • 2. Problem solving • We want: – To automatically solve a problem • We need: – A representation of the problem – Algorithms that use some strategy to solve the problem defined in that representation
  • 3. Problem representation • General: – State space: a problem is divided into a set of resolution steps from the initial state to the goal state – Reduction to sub-problems: a problem is arranged into a hierarchy of sub-problems • Specific: – Game resolution – Constraints satisfaction
  • 4. States • A problem is defined by its elements and their relations. • In each instant of the resolution of a problem, those elements have specific descriptors (How to select them?) and relations. • A state is a representation of those elements in a given moment. • Two special states are defined: – Initial state (starting point) – Final state (goal state)
  • 5. State modification: successor function • A successor function is needed to move between different states. • A successor function is a description of possible actions, a set of operators. It is a transformation function on a state representation, which convert it into another state. • The successor function defines a relation of accessibility among states. • Representation of the successor function: – Conditions of applicability – Transformation function
  • 6. State space • The state space is the set of all states reachable from the initial state. • It forms a graph (or map) in which the nodes are states and the arcs between nodes are actions. • A path in the state space is a sequence of states connected by a sequence of actions. • The solution of the problem is part of the map formed by the state space.
  • 7. Problem solution • A solution in the state space is a path from the initial state to a goal state or, sometimes, just a goal state. • Path/solution cost: function that assigns a numeric cost to each path, the cost of applying the operators to the states • Solution quality is measured by the path cost function, and an optimal solution has the lowest path cost among all solutions. • Solutions: any, an optimal one, all. Cost is important depending on the problem and the type of solution sought.
  • 8. Problem description • Components: – State space (explicitly or implicitly defined) – Initial state – Goal state (or the conditions it has to fulfill) – Available actions (operators to change state) – Restrictions (e.g., cost) – Elements of the domain which are relevant to the problem (e.g., incomplete knowledge of the starting point) – Type of solution: • Sequence of operators or goal state • Any, an optimal one (cost definition needed), all
  • 9. Example: 8-puzzle 1 2 3 4 5 6 7 8
  • 10. Example: 8-puzzle • State space: configuration of the eight tiles on the board • Initial state: any configuration • Goal state: tiles in a specific order • Operators or actions: “blank moves” – Condition: the move is within the board – Transformation: blank moves Left, Right, Up, or Down • Solution: optimal sequence of operators
  • 11. Example: n queens (n = 4, n = 8)
  • 12. Example: n queens (n = 4, n = 8) • State space: configurations from 0 to n queens on the board with only one queen per row and column • Initial state: configuration without queens on the board • Goal state: configuration with n queens such that no queen attacks any other • Operators or actions: place a queen on the board  Condition: the new queen is not attacked by any other already placed  Transformation: place a new queen in a particular square of the board • Solution: one solution (cost is not considered)
  • 13. Structure of the state space • Data structures: – Trees: only one path to a given node – Graphs: several paths to a given node • Operators: directed arcs between nodes • The search process explores the state space. • In the worst case all possible paths between the initial state and the goal state are explored.
  • 14. Search as goal satisfaction • Satisfying a goal – Agent knows what the goal is – Agent cannot evaluate intermediate solutions (uninformed) – The environment is: • Static • Observable • Deterministic
  • 15. Example: holiday in Romania • On holiday in Romania; currently in Arad • Flight leaves tomorrow from Bucharest at 13:00 • Let’s configure this to be an AI problem
  • 16. Romania • What’s the problem? – Accomplish a goal • Reach Bucharest by 13:00 • So this is a goal-based problem
  • 17. Romania • What’s an example of a non-goal-based problem? – Live long and prosper – Maximize the happiness of your trip to Romania – Don’t get hurt too much
  • 18. Romania • What qualifies as a solution? – You can/cannot reach Bucharest by 13:00 – The actions one takes to travel from Arad to Bucharest along the shortest (in time) path
  • 19. Romania • What additional information does one need? – A map
  • 20. More concrete problem definition Which cities could you be A state space in? Which city do you start An initial state from? Which city do you aim to A goal state reach? When in city foo, the A function defining state following cities can be transitions reached A function defining the How long does it take to “cost” of a state travel through a city sequence? sequence
  • 21. More concrete problem definition A state space Choose a representation Choose an element from the An initial state representation Create goal_function(state) such A goal state that TRUE is returned upon reaching goal successor_function(statei) = A function defining state {<actiona, statea>, <actionb, stateb>, transitions …} A function defining the “cost” of a cost (sequence) = number state sequence
  • 22. Important notes about this example – Static environment (available states, successor function, and cost functions don’t change) – Observable (the agent knows where it is) – Discrete (the actions are discrete) – Deterministic (successor function is always the same)
  • 23. Tree search algorithms • Basic idea: – Simulated exploration of state space by generating successors of already explored states (AKA expanding states) Sweep out from start (breadth)
  • 24. Tree search algorithms • Basic idea: – Simulated exploration of state space by generating successors of already explored states (AKA expanding Go East, young man! (depth) states)
  • 25. Implementation: general search algorithm Algorithm General Search Open_states.insert (Initial_state) Current= Open_states.first() while not is_final?(Current) and not Open_states.empty?() do Open_states.delete_first() Closed_states.insert(Current) Successors= generate_successors(Current) Successors= process_repeated(Successors, Closed_states, Open_states) Open_states.insert(Successors) Current= Open_states.first() eWhile eAlgorithm
  • 26. Example: Arad  Bucharest Algorithm General Search Open_states.insert (Initial_state) Arad
  • 27. Example: Arad  Bucharest • Current= Open_states.first() Arad
  • 28. Example: Arad  Bucharest while not is_final?(Current) and not Open_states.empty?() do Open_states.delete_first() Closed_states.insert(Current) Successors= generate_successors(Current) Successors= process_repeated(Successors, Closed_states, Open_states) Open_states.insert(Successors) Arad Zerind (75) Timisoara (118) Sibiu (140)
  • 29. Example: Arad  Bucharest • Current= Open_states.first() Arad Zerind (75) Timisoara (118) Sibiu (140)
  • 30. Example: Arad  Bucharest while not is_final?(Current) and not Open_states.empty?() do Open_states.delete_first() Closed_states.insert(Current) Successors= generate_successors(Current) Successors= process_repeated(Successors, Closed_states, Open_states) Open_states.insert(Successors) Arad Zerind (75) Timisoara (118) Sibiu (140) Dradea (151) Faragas (99) Rimnicu Vilcea (80)
  • 31. Implementation: states vs. nodes • State – (Representation of) a physical configuration • Node – Data structure constituting part of a search tree • Includes parent, children, depth, path cost g(x) • States do not have parents, children, depth, or path cost!
  • 32. Search strategies • A strategy is defined by picking the order of node expansion • Strategies are evaluated along the following dimensions: – Completeness – does it always find a solution if one exists? – Time complexity – number of nodes generated/expanded – Space complexity – maximum nodes in memory – Optimality – does it always find a least-cost solution?
  • 33. Search strategies • Time and space complexity are measured in terms of: – b – maximum branching factor of the search tree (may be infinite) – d – depth of the least-cost solution – m – maximum depth of the state space (may be infinite)
  • 34. Uninformed Search Strategies • Uninformed strategies use only the information available in the problem definition – Breadth-first search – Uniform-cost search – Depth-first search – Depth-limited search – Iterative deepening search
  • 35. Nodes • Open nodes: – Generated, but not yet explored – Explored, but not yet expanded • Closed nodes: – Explored and expanded 35
  • 36. Breadth-first search • Expand shallowest unexpanded node • Implementation: – A FIFO queue, i.e., new successors go at end
  • 37. Space cost of BFS • Because you must be able to generate the path upon finding the goal state, all visited nodes must be stored • O (bd+1)
  • 38. Properties of breadth-first search • Complete? – Yes (if b (max branch factor) is finite) • Time? – 1 + b + b2 + … + bd + b(bd-1) = O(bd+1), i.e., exponential in d • Space? – O(bd+1) (keeps every node in memory) • Optimal? – Only if cost = 1 per step, otherwise not optimal in general • Space is the big problem; it can easily generate nodes at 10 MB/s, so 24 hrs = 860GB!
  • 39. Depth-first search • Expand deepest unexpanded node • Implementation: – A LIFO queue, i.e., a stack
  • 40. Depth-first search • Complete? – No: fails in infinite-depth spaces, spaces with loops. – Can be modified to avoid repeated states along path  complete in finite spaces • Time? – O(bm): terrible if m is much larger than d, but if solutions are dense, may be much faster than breadth-first • Space? – O(bm), i.e., linear space! • Optimal? – No
  • 41. Depth-limited search • It is depth-first search with an imposed limit on the depth of exploration, to guarantee that the algorithm ends. 41
  • 42. Treatment of repeated states • Breadth-first: – If the repeated state is in the structure of closed or open nodes, the actual path has equal or greater depth than the repeated state and can be forgotten. 42
  • 43. Treatment of repeated states • Depth-first: – If the repeated state is in the structure of closed nodes, the actual path is kept if its depth is less than the repeated state. – If the repeated state is in the structure of open nodes, the actual path has always greater depth than the repeated state and can be forgotten. 43
  • 45. Iterative deepening search • The algorithm consists of iterative, depth-first searches, with a maximum depth that increases at each iteration. Maximum depth at the beginning is 1. • Behavior similar to BFS, but without the spatial complexity. • Only the actual path is kept in memory; nodes are regenerated at each iteration. • DFS problems related to infinite branches are avoided. • To guarantee that the algorithm ends if there is no solution, a general maximum depth of exploration can be defined. 45
  • 47. Summary – All uninformed searching techniques are more alike than different. – Breadth-first has space issues, and possibly optimality issues. – Depth-first has time and optimality issues, and possibly completeness issues. – Depth-limited search has optimality and completeness issues. – Iterative deepening is the best uninformed search we have explored.
  • 48. Uninformed vs. informed • Blind (or uninformed) search algorithms: – Solution cost is not taken into account. • Heuristic (or informed) search algorithms: – A solution cost estimation is used to guide the search. – The optimal solution, or even a solution, are not guaranteed. 48