You have to fill the boxes with numbers from 1-8 by following below mentioned rules.

Rule 1: Predecessor and successor can’t be besides. Example if we take number 3 in any box, than neither side of 3 can have 2 or 4.

Rule 2: Predecessor and successor can’t be upside or downside. Example: if we take 3 in any box, then the box above can not have 2 or 4, similarly box below can not have 2 or 4.

Rule 3: Predecessor and successor can’t be diagonally either.

Rule 4: c is smaller than f, else there can be 2 solutions.

And now there can be only 1 solution.