Page 44 - UR221 Creative & Scientific Thinking_Neat
P. 44

3.21 Heuristic Problem Solving



                  3. Update the largest value if a bigger number is found

                  4. Return the result



               3.21       Heuristic Problem Solving


                   Heuristics are problem-solving strategies that aim for good enough solutions rather
               than perfect ones. They are especially useful when:

                   ˆ   roblems are too complex                                                                                 P

                   ˆ   xact solutions are expensive                                                                            E

                   ˆ   ime constraints exist                                                                                   T
               Heuristics are widely used in:

                   ˆ   rtificial intelligence                                                                                  A

                   ˆ   earch algorithms                                                                                        S

                   ˆ   ptimization problems                                                                                    O
               Example: Heuristic Search Logic




















                                           Figure 3.5: Heuristic Search Logic



                   This simple heuristic selects the cheaper path without exploring all possibilities.



               3.22       Trial and Error Technique


                   Trial and error involves testing different solutions until an acceptable one is found.
               While inefficient for large problems, it can be useful for:

                   ˆ   earning                                                                                                 L

                   ˆ   rototyping                                                                                              P

                   ˆ   ebugging                                                                                                D
               In programming, trial and error is often guided by testing and feedback.


                                                     35
   39   40   41   42   43   44   45   46   47   48   49