Artificial IntelligenceUnit 1112 min read
Knowledge Representation Issues & AI Solutions
Unit 11 of Artificial Intelligence explores the challenges in representing knowledge in AI systems (e.g., ambiguity, scalability, and reasoning inefficiencies) and evaluates solutions like semantic networks, frames, and ontologies. It contrasts uninformed vs. informed search techniques, demonstrates heuristic-driven op
TAKEAWAYS:
- Knowledge representation issues include ambiguity, scalability, and inefficiency in reasoning, which can be mitigated by structured formats like semantic networks or ontologies.
- Heuristic search (e.g., A*) outperforms uninformed search (e.g., BFS/DFS) by using domain-specific knowledge to prune search spaces, but requires careful heuristic design to avoid suboptimal paths.
- Semantic networks visually model relationships (e.g., "is-a" hierarchies) but struggle with complex constraints, while frames organize knowledge into slots and default values for efficiency.
- Ontologies provide formal, shared vocabularies (e.g., for medical diagnoses or eSewa’s citizen-service categories) but demand high maintenance for evolving domains.
- Real-world applications: A* optimizes Pathao’s ride-matching routes, semantic networks power Ncell’s customer-service chatbots, and ontologies standardize NEPSE’s stock-trading rules.
- Exam focus: Compare search algorithms, solve constraint problems (e.g., N-Queens), and justify solutions to representation issues with examples.
1. Knowledge Representation Issues
Knowledge representation (KR) is the cornerstone of AI, but real-world systems face critical challenges:
A. Core Issues
Ambiguity and Uncertainty
- Problem: Natural language (e.g., "The bank loan was denied because the applicant was poor") is inherently ambiguous. Is "poor" a financial term or a moral judgment? KR systems must disambiguate context.
- Example: In eSewa, a user’s query "My bill is high" could refer to electricity, water, or internet. The system must infer intent from user history or semantic links.
- Visual:
graph LR A["User Query: 'Bill is high'"] --> B["Electricity Bill"] A --> C["Water Bill"] A --> D["Internet Bill"] B --> E["Check eSewa history"] C --> F["Check NTC records"] D --> G["Check Ncell portal"]
Scalability
- Problem: Representing knowledge for large domains (e.g., medical diagnoses or Daraz’s inventory) becomes computationally infeasible with naive methods like propositional logic.
- Example: Ncell’s network routing must represent millions of base stations and user devices. A flat KR system would collapse under the data load.
Inefficient Reasoning
- Problem: Some KR formats (e.g., predicate logic) force brute-force searches, slowing down applications like real-time fraud detection in banks.
- Example: Khalti’s transaction verification must quickly validate user identities. A slow KR system could enable fraud.
Dynamic Knowledge
- Problem: Real-world knowledge evolves (e.g., traffic rules in Kathmandu change annually). Static KR systems become obsolete.
- Example: Pathao’s surge pricing relies on real-time demand data. A KR system must update dynamically.
Interoperability
- Problem: Different AI systems (e.g., NTC’s grid management vs. NEPSE’s trading) use incompatible KR formats, hindering integration.
- Example: Smart city projects in Nepal require seamless data exchange between traffic (KTMMC), energy (NTC), and transport (Pathao) systems.
B. Solutions to KR Issues
| Issue | Solution | Example | Limitations |
|---|---|---|---|
| Ambiguity | Semantic Networks, Ontologies | eSewa’s intent classification | Requires manual annotation |
| Scalability | Frames, Object-Oriented KR | Daraz’s product catalog | Overhead in slot-filling |
| Inefficient Reasoning | Heuristic Search (A*, IDA*) | Pathao’s route optimization | Heuristic design is domain-specific |
| Dynamic Knowledge | Hybrid KR (Logic + Neural Networks) | Ncell’s real-time network updates | High computational cost |
| Interoperability | Standardized Ontologies (OWL, RDF) | NEPSE’s trading rules | Steep learning curve for developers |
2. Search Techniques Revisited: Heuristics in Action
To solve KR issues, AI often combines search techniques with domain knowledge. Compare:
A. Uninformed vs. Informed Search
| Feature | Uninformed Search (BFS, DFS, UCS) | Informed Search (Greedy, A, IDA)** |
|---|---|---|
| Guidance | No domain knowledge | Uses heuristics (e.g., distance estimates) |
| Optimality | Guaranteed (UCS) or not (BFS/DFS) | Not guaranteed unless admissible heuristic |
| Speed | Slow (explores all paths) | Faster (prunes unlikely paths) |
| Memory | High (stores all nodes) | Lower (focuses on promising paths) |
B. Heuristic Functions: How They Work
A heuristic estimates the cost from node to the goal. For A*:
- : Cost from start to
- : Heuristic estimate to goal
Example: Pathao’s Ride-Matching
- State: Current driver locations, passenger pickup/drop points.
- Operators: Assign driver → passenger, update routes.
- Heuristic: (approximate travel time).
- Goal: Minimize total ride time.
graph TD A["Start: Driver at A, Passenger at P"] -->|"h(A)=5"| B["Assign Driver 1"] B -->|"g(B)=3"| C["Driver moves to P"] C -->|"h(C)=2"| D["Passenger reaches D"] D["Goal: Total cost = 5"]
Trace for A vs. Greedy*: Assume grid coordinates (start at (0,0), goal at (4,4)) and heuristic .
| Node | g(n) | h(n) | f(n) = g(n) + h(n) | Path | Algorithm |
|---|---|---|---|---|---|
| (0,0) | 0 | 8 | 8 | Start | Both |
| (1,0) | 1 | 7 | 8 | Right | Both |
| (1,1) | 2 | 6 | 8 | Diagonal | A* |
| (2,2) | 4 | 4 | 8 | Diagonal | A* |
| (3,3) | 6 | 2 | 8 | Diagonal | A* |
| (4,4) | 8 | 0 | 8 | Goal | A* |
Greedy might take (0,0) → (4,0) → (4,4) (cost = 8), but A* finds the optimal path (diagonal) with cost = 8 (same here, but differs in complex grids).
3. Knowledge Representation Formats
A. Semantic Networks
- Definition: Directed graphs where nodes represent concepts and edges represent relationships (e.g.,
is-a,has-part). - Example: Ncell’s Customer Service
graph TD A["Customer"] -->|"is-a"| B["User"] B -->|"has"| C["Subscription"] C -->|"type"| D["Prepaid"] C -->|"type"| E["Postpaid"] D -->|"includes"| F["Data Plan"] E -->|"includes"| G["Roaming"]
- Pros: Intuitive, handles hierarchies well.
- Cons: Struggles with complex constraints (e.g., "if X then Y unless Z").
B. Frames
- Definition: Structured templates with slots (attributes) and default values.
- Example: Daraz’s Product Catalog
classDiagram class Product { +name: String +price: Float +stock: Integer +category: String +is_available(): Boolean } class Electronics { +warranty: String +brand: String } Product <|-- Electronics - Pros: Efficient for object-oriented data (e.g., inventory).
- Cons: Inflexible for non-hierarchical relationships.
C. Ontologies
- Definition: Formal, shared vocabularies with hierarchical relationships (e.g., OWL, RDF).
- Example: NEPSE’s Trading Rules
Stockis-aFinancialInstrumentTradehas-partBuyerandSellerBuyermust-haveDematAccount
- Pros: Enables interoperability (e.g., between banks and NEPSE).
- Cons: Requires expert curation.
4. Real-World Applications
A. A in Pathao’s Route Optimization*
- Problem: Match drivers to passengers in Kathmandu’s traffic (dynamic obstacles, tolls, one-way streets).
- Heuristic: .
- Example Trace:
- State: Driver at Thapathali, passenger at Lakshmi Chowk.
- Heuristic: Avoids Ring Road (tolls) → suggests route via Putalisadak.
- Result: 12-minute ride vs. 18-minute toll-heavy path.
B. Semantic Networks in eSewa
- Problem: Disambiguate user queries like "My bill is pending."
- Solution: Links queries to:
Bill→Type(electricity/water/internet)Status→Pending/Paid/Disputed
- Visual:
graph TD A["User: 'Bill pending'"] --> B["Electricity Bill"] A --> C["Water Bill"] B --> D["Check NTC Portal"] C --> E["Check Kathmandu Uddyog Laghubitta"]
C. Frames in Daraz’s Inventory
- Problem: Track product attributes (e.g., size, color, stock).
- Solution: Frame for
Electronics:classDiagram class Electronics { +name: String +price: Float +stock: Integer +category: String +specs: Map<String, String> } class Smartphone { +brand: String +ram: String +storage: String } Electronics <|-- Smartphone - Example: A
Smartphoneframe auto-filters low-stock items for restock alerts.
D. Ontologies in NEPSE
- Problem: Standardize trading rules across brokers.
- Solution: OWL ontology defines:
Trademust haveBuyer,Seller,Quantity,Price.Buyermust haveDematAccountwithBalance > 0.
- Impact: Reduces fraud by enforcing rules uniformly.
5. Constraint Satisfaction with Heuristics
A. N-Queens Problem with Heuristic Search
Problem: Place 4 queens on a 4×4 board so no two attack each other. States: Board configurations. Operators: Place/remove a queen. Constraints:
- No two queens share a row/column/diagonal.
- Heuristic: .
Trace with A*:
- Initial State: Empty board.
- Place Queen at (0,0) → .
- Place Queen at (1,2) → Check diagonals/columns.
- Place Queen at (2,1) → Conflict with (0,0) diagonal.
- Backtrack and try (1,3).
- Place Queen at (3,0) → Valid solution.
graph TD A["Start"] --> B["(0,0)"] --> C["(1,2)"] --> D["(2,1) Conflict"] D --> E["Backtrack"] --> F["(1,3)"] --> G["(3,0) Solution"]
Real Analogy: Kathmandu Traffic Routes
- Queens = Vehicles at intersections.
- Constraints = No two vehicles block each other.
- Heuristic: Prioritize routes with least congestion (like A*’s ).
6. Exam Tip: How to Score Full Marks
Compare Search Algorithms
- Always show a table (like above) and a trace with small numbers (e.g., 4×4 grid).
- Highlight why A is better: "A guarantees optimality if is admissible, unlike greedy which may take suboptimal paths."
Solve Constraint Problems
- For N-Queens or similar, list states, operators, and constraints explicitly.
- Use a visual trace (like the Mermaid graph above) to show backtracking.
Knowledge Representation Issues
- Name the issue (e.g., "ambiguity") and link to a real system (e.g., "eSewa’s query disambiguation").
- Propose a solution with pros/cons (e.g., "semantic networks reduce ambiguity but require manual annotation").
Ontologies vs. Frames
- Ontologies = Shared vocabularies (e.g., NEPSE’s trading rules).
- Frames = Object templates (e.g., Daraz’s product catalog).
- Contrast: "Frames are efficient for static data, while ontologies handle dynamic, interoperable domains."
Heuristic Design
- For A*, explain why your heuristic is admissible (e.g., "Manhattan distance never overestimates actual path cost").
- Example: In Pathao, "Toll costs are fixed and known in advance, so they can be added to without overestimation."
Final Note: This unit tests your ability to connect theory to real systems. Always tie examples to Nepalese contexts (e.g., Ncell, Daraz, eSewa) and use visual traces for search problems. For ontologies, draw a small hierarchy; for frames, use a class diagram. Good luck!
Based on the TU BCA syllabus for Artificial Intelligence (CACS410), unit 11.
Discussion
Loading…