Efficient Case Retrieval Sources: –Chapter 7 –www.iiia.csic.es/People/enric/AICom.html –www.ai-cbr.org.

Slides:



Advertisements
Similar presentations
K-Nearest Neighbors (kNN) Given a case base CB, a new problem P, and a similarity metric sim Obtain: the k cases in CB that are most similar to P according.
Advertisements

1 Merge Sort Review of Sorting Merge Sort. 2 Sorting Algorithms Selection Sort uses a priority queue P implemented with an unsorted sequence: –Phase 1:
Heapsort By: Steven Huang. What is a Heapsort? Heapsort is a comparison-based sorting algorithm to create a sorted array (or list) Part of the selection.
CMPT 225 Priority Queues and Heaps. Priority Queues Items in a priority queue have a priority The priority is usually numerical value Could be lowest.
FALL 2004CENG 351 Data Management and File Structures1 External Sorting Reference: Chapter 8.
FALL 2006CENG 351 Data Management and File Structures1 External Sorting.
Binary Search Trees vs. Binary Heaps. Binary Search Tree Condition Given a node i –i.value is the stored object –i.left and i.right point to other nodes.
Lec 6 Feb 17, 2011  Section 2.5 of text (review of heap)  Chapter 3.
Chapter 6: Priority Queues Priority Queues Binary Heaps Mark Allen Weiss: Data Structures and Algorithm Analysis in Java Lydia Sinapova, Simpson College.
Source: Muangsin / Weiss1 Priority Queue (Heap) A kind of queue Dequeue gets element with the highest priority Priority is based on a comparable value.
Week 10: Heap and Priority queue. Any feature here?
PQ, binary heaps G.Kamberova, Algorithms Priority Queue ADT Binary Heaps Gerda Kamberova Department of Computer Science Hofstra University.
CS Data Structures Chapter 5 Trees. Additional Binary Tree Operations (1/7)  Copying Binary Trees  we can modify the postorder traversal algorithm.
Efficient Case Retrieval Sources: –Chapter 7 – –
Priority Queues, Heaps & Leftist Trees
Geoff Holmes and Bernhard Pfahringer COMP206-08S General Programming 2.
Compiled by: Dr. Mohammad Alhawarat BST, Priority Queue, Heaps - Heapsort CHAPTER 07.
CHAPTER 09 Compiled by: Dr. Mohammad Omar Alhawarat Sorting & Searching.
Binomial Queues Text Read Weiss, §6.8 Binomial Queue Definition of binomial queue Definition of binary addition Building a Binomial Queue Sequence of inserts.
Priority Queues and Binary Heaps Chapter Trees Some animals are more equal than others A queue is a FIFO data structure the first element.
Data Structures Week 8 Further Data Structures The story so far  Saw some fundamental operations as well as advanced operations on arrays, stacks, and.
1 Heaps and Priority Queues Starring: Min Heap Co-Starring: Max Heap.
Sorting. Pseudocode of Insertion Sort Insertion Sort To sort array A[0..n-1], sort A[0..n-2] recursively and then insert A[n-1] in its proper place among.
Data Structure & Algorithm II.  In a multiuser computer system, multiple users submit jobs to run on a single processor.  We assume that the time required.
Algorithms and data structures Protected by
Data Structures Types of Data Structure Data Structure Operations Examples Choosing Data Structures Data Structures in Alice.
Priority Queues and Heaps. October 2004John Edgar2  A queue should implement at least the first two of these operations:  insert – insert item at the.
+ David Kauchak cs312 Review. + Midterm Will be posted online this afternoon You will have 2 hours to take it watch your time! if you get stuck on a problem,
CHAPTER 5 PRIORITY QUEUES (HEAPS) §1 ADT Model Objects: A finite ordered list with zero or more elements. Operations:  PriorityQueue Initialize( int.
Priority Queues Two kinds of priority queues: Min priority queue. Max priority queue. Nov 4,
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part R3. Priority Queues.
FALL 2005CENG 213 Data Structures1 Priority Queues (Heaps) Reference: Chapter 7.
FALL 2005CENG 351 Data Management and File Structures1 External Sorting Reference: Chapter 8.
Heaps © 2010 Goodrich, Tamassia. Heaps2 Priority Queue ADT  A priority queue (PQ) stores a collection of entries  Typically, an entry is a.
Amortized Analysis and Heaps Intro David Kauchak cs302 Spring 2013.
Heaps, Heap Sort, and Priority Queues. Background: Binary Trees * Has a root at the topmost level * Each node has zero, one or two children * A node that.
Mohammed I DAABO COURSE CODE: CSC 355 COURSE TITLE: Data Structures.
Data Structures and Algorithms for Information Processing
CS 201 Data Structures and Algorithms
Heaps (8.3) CSE 2011 Winter May 2018.
Priority Queues An abstract data type (ADT) Similar to a queue
CMPS 3130/6130 Computational Geometry Spring 2017
Priority Queues Chuan-Ming Liu
CS 2511 Fall 2014 Binary Heaps.
Hashing Exercises.
Source: Muangsin / Weiss
ADT Heap data structure
original list {67, 33,49, 21, 25, 94} pass { } {67 94}
Chapter 8 – Binary Search Tree
Fundamentals of Python: From First Programs Through Data Structures
Priority Queues.
Heap Sort The idea: build a heap containing the elements to be sorted, then remove them in order. Let n be the size of the heap, and m be the number of.
Balanced-Trees This presentation shows you the potential problem of unbalanced tree and show two way to fix it This lecture introduces heaps, which are.
Priority Queues.
Priority Queues (Chapter 6.6):
Balanced-Trees This presentation shows you the potential problem of unbalanced tree and show two way to fix it This lecture introduces heaps, which are.
Priority Queues An abstract data type (ADT) Similar to a queue
Priority Queues & Heaps
Introduction to Data Structure
Fundamentals of Python: From First Programs Through Data Structures
CENG 351 Data Management and File Structures
Amortized Analysis and Heaps Intro
Priority Queues (Chapter 6):
B-Trees.
Data Structures for Shaping and Scheduling
Heaps & Multi-way Search Trees
A Heap Is Efficiently Represented As An Array
The Heap ADT A heap is a complete binary tree where each node’s datum is greater than or equal to the data of all of the nodes in the left and right.
Heaps Section 6.4, Pg. 309 (Section 9.1).
Presentation transcript:

Efficient Case Retrieval Sources: –Chapter 7 – –

Themes Sequential Retrieval Two-Step Retrieval Retrieval with Indexed Cases

Problem Description Input: a collection of cases CB = {C 1, …C n } and a new problem P Output:  The most similar case: A case C i in CB such that sim(C i, P) is minimal, or  A collection of m most similar cases in CB {C i,…, C j }, or  A sufficiently similar case: case C i in CB such that sim(C i, P) > th where th is a predefined threshold

Priority Queues Typical example: These priorities may override the FIFO policy of the queues Operations supported in a priority queue: Insert a new element Extract/Delete of the element with the lowest priority printing in a Unix/Linux environment. Printing jobs have different priorities.

Implementing Priority Queues: HEAPS A heap is a binary tree T such that: The key at each node is less or equal than the key of its children T is complete We assume that each node has a key, K, and other information, I. K is the priority of I.

(Non) Examples > 9! Tree is not complete Complexity of insert, remove is O(log 2 n). Top element: constant

Sequential Retrieval The case base is organized as a a sequence of cases with no order among themselves (i.e., no indexing) Retrieving the most similar or one that passes the threshold condition is straightforward  How to implement an efficient procedure to retrieve the m most similar cases:  Use heaps!

Sequential Retrieval (II) How to implement an efficient procedure to retrieve the m most similar cases to a problem P:  Keep all candidate cases in a heap, H  Initially fill H with the first m cases. Each with a priority:  When looking at a case C in the case base, compared it against the one on the top, T, of the heap H  If then remove T from H and add C with a priority sim(C,P) sim(, P) sim(C,P) > sim(T,P)

Properties of Sequential Retrieval Complexity of retrieval of most similar or one that passes the threshold = O( )  Complexity of retrieval of m most similar with heaps: O( log 2 (m))  Drawbacks:  If ( is too large, retrieval time may take too long (despite the low complexity)  Retrieval time is independent from the problem  Advantages:  Independent of the similarity  Simple; doesn’t require complex indexing code

Two-Step Retrieval The Mac/Fac approach (many are called/few are chosen): 1.Compute the set Cand with all cases in CB such that SIM(C,P) holds 2.Search for similar case in Cand  The question is how to define the relation SIM such that 1. Computing the relation SIM should require much less effort than computing the similarity metric, sim 2. SIM doesn’t eliminate good candidates

Possible Definitions of SIM  Partial equality: SIM(C,P) iff C and P have the same value on a pre-selected attribute  Local similarity: SIM(C,P) iff the values of attributes in C and P are sufficiently similar  Domain-specific SIM: (example: in the restaurant domain if P indicates the type of restaurant, one may pre-select all cases of the same type) (example: if sim = sqr((x-v) 2 + (y-v) 2 ) ) one could define SIM iff |x-v| < 10) (example: Process Planning domain) Heuristics

Example of a “Good” SIM pa 1 pa 2 Any case for which pa 1 is not ordered before pa 2 should not be retrieved One can use these dependencies as criterion for construction SIM (Munoz-Avila & Huellen, ICCBR-1995) Problem:

Properties of Two-Step Retrieval Advantage:  Disadvantages:  May lead to a reduction in time May result in  -error: cases very similar to the problem are discarded Obtaining SIM maybe difficult