Challenge: Grid Search

Challenge yourself by solving a house searching problem using grid search.

Problem statement

You are searching for a house considering the following two criteria:

  • x1x_1: This is the distance (in km) of the house from the nearest hospital. x1<0x_1 < 0 means that the house is located on the left side (or neighborhood) of the hospital and x10x_1 \geq 0 means that the house is located on the right side (or neighborhood) of the hospital.

  • x2x_2: This is the distance (in km) of the house from the nearest market. x2<0x_2 < 0 means that the house is located on the left side (or neighborhood) of the market and x20x_2 \geq 0 means that the house is located on the right side (or neighborhood) of the market.

Based on its location from the hospital and the market, the value for money of the house varies according to the f(x1,x2)f(x_1, x_2) objective function. You need to select the optimal location (x1,x2)(x_1, x_2) of the house that has the best value for money subject to the conditions that its distance from the hospital and market should be at least α\alpha and β\beta, respectively.

Mathematical formulation

Suppose the objective function f(x1,x2)f(x_1, x_2) is hypothesized as follows:

Get hands-on with 1200+ tech skills courses.