001    package aima.search.uninformed;
002    
003    import java.util.List;
004    
005    import aima.search.framework.Metrics;
006    import aima.search.framework.Problem;
007    import aima.search.framework.QueueSearch;
008    import aima.search.framework.Search;
009    import aima.search.nodestore.FIFONodeStore;
010    
011    /**
012     * Artificial Intelligence A Modern Approach (2nd Edition): page 73.
013     * 
014     * Breadth-first search.
015     */
016    public class BreadthFirstSearch implements Search {
017    
018            private final QueueSearch search;
019    
020            public BreadthFirstSearch(QueueSearch search) {
021                    this.search = search;
022            }
023    
024            public List search(Problem p) {
025                    return search.search(p, new FIFONodeStore());
026            }
027    
028            public Metrics getMetrics() {
029                    return search.getMetrics();
030            }
031    
032    }