How to Estimate DAG (Directed Acyclic Graph) with Hill Climb Search

AI Maverick
4 min readJan 28, 2023

--

Hill Climb Search

Hill Climbing is a heuristic optimization algorithm that iteratively moves towards a solution in a greedy manner by choosing the move that locally maximizes a given objective function. It is a simple form of local search optimization that can be used to solve optimization problems in various fields including artificial intelligence, operations research, and mathematics.

Introduction

Hill Climbing is a simple optimization algorithm that tries to find the global optimum of a given objective function by making iterative moves towards better solutions. The algorithm starts with an initial solution and then repeatedly selects the best neighbor solution (one that improves the objective function) until no further progress can be found. Hill Climbing is a greedy algorithm, as it always chooses the solution that appears to be best at the current moment, without considering the long-term impact of its choices. This can sometimes result in getting stuck in a local optimum instead of finding the global optimum.

Applications

Some of the common applications include:

  1. Robotics: Hill Climbing can be used to find the best control inputs for robotic systems to achieve a desired goal.
  2. Machine learning: Hill Climbing can be used to optimize the hyperparameters of a machine learning model.
  3. Operations research: Hill Climbing can be used to solve problems such as the traveling salesman problem, where the objective is to find the shortest path that visits a set of cities and returns to the starting city.
  4. Game AI: Hill Climbing can be used to train game AI agents by finding the best moves to make in a game.
  5. Function optimization: Hill Climbing can be used to find the global maximum or minimum of a mathematical function.
  6. Combinatorial optimization: Hill Climbing can be used to solve problems such as the knapsack problem, where the goal is to find the most valuable items to pack into a knapsack given a weight constraint.

These are some of the applications of Hill Climbing. The algorithm can be adapted and combined with other optimization techniques to solve a wide range of optimization problems in various fields.

Tabular dataset

Hill Climbing can be applied to a tabular dataset by treating each row as a potential solution and the objective function as a metric that evaluates the quality of each solution. Here’s how the algorithm works with a tabular dataset:

  1. Initialization: Start with an initial solution, which can be a randomly selected row from the dataset or a pre-defined starting point.
  2. Evaluation: Evaluate the objective function for the current solution to determine its quality.
  3. Neighbour Generation: Generate the set of neighboring solutions by making small changes to the current solution, such as switching the values of two columns or adding a small amount of random noise.
  4. Selection: Select the neighbor solution that results in the highest improvement in the objective function.
  5. Repeat: Repeat steps 2–4 until no further improvement can be found. At this point, the current solution is considered to be the best solution found so far.
  6. Termination: If a stopping criterion is met, such as reaching a maximum number of iterations or finding a solution that is good enough, the algorithm terminates and returns the best solution found.

By repeating these steps, Hill Climbing can converge to a local optimum of the objective function, which may or may not be the global optimum. The algorithm’s performance can be improved by using techniques such as random restarts or incorporating randomness into the selection of the next solution.

How to Estimate DAG (Directed Acyclic Graph) with Hill Climb Search

This algorithm works as follows:

  1. Initialization: Start with a random initial structure of the Bayesian network or a pre-defined structure.
  2. Evaluation: Evaluate the quality of the current structure using a scoring function, such as the Bayesian Information Criterion (BIC) or the Akaike Information Criterion (AIC).
  3. Neighbour Generation: Generate a set of neighboring structures by making small modifications to the current structure, such as adding or removing edges between variables.
  4. Selection: Select the neighboring structure that results in the highest improvement in the scoring function.
  5. Repeat: Repeat steps 2–4 until no further improvement can be found. At this point, the current structure is considered to be the best structure found so far.
  6. Termination: If a stopping criterion is met, such as reaching a maximum number of iterations or finding a structure that is good enough, the algorithm terminates and returns the best structure found.

By using Hill Climbing, the HillClimbSearch estimator can find a structure for a Bayesian network that optimizes the chosen scoring function. This structure can then be used for tasks such as probabilistic inference, causal inference, and model selection.

--

--