# Push Path Settings

When finding push path (how to push box from some cell to some other cell) YSokoban tries to find the way with smallest possible number of pushes. This requirement is natural because the goal is to move box, man can go round, but the important result is to find how to push box. The other reason is that in real life usually pushing heavy box is harder than just going around it.

Many people has opposite opinion. For them number of moves are more important than number of pushes, this comes perhaps from back from DOS version time where moving man was possible only with keyboard and it was not a nice task, so important thing was how many times one will press some key.

In push path optimization dialog (activated from menu) there is a possibility to fine tune the optimization criteria for push path.

By default (if "Use weights" check box is not checked) program optimizes push path by number of pushes. These means that program will use the path which has smallest number of pushes (there could be a lot of moves but the number of pushes is smallest). If there are more than one path (with same number of pushes) program will select the one which has less moves.

If you select (check) "Use weights" then you can specify weight for each of 3 components of a path: moves, pushes and lines. Lines are usually not considered at all by most of the players. YSokoban will find push path with smallest value of:

    MOVES*movesWeight + PUSHES*pushWeight + LINES*linesWeight

Perhaps you will prefer to optimize only number of moves, but if you wish you can select more complex criteria. If you select 0 as weight for moves and 0 as weight for inlines then program will automatically deselect "Use weights" and will use default optimization (because X, 0, 0 is default optimization regardless of X value).

Check box "Count push as push + move" means that every push is counted as move too. For optimization procedure you could specify that they are independent (otherwise moves are always more than pushes). This option is only for push path optimizer and is independent from checkbox with same meaning in Options dialog box.

In any case if there are two paths with same (lowest) value for optimization formula then program will select this one which has smallest number of pushes and if they are equal, then smallest number of moves and if they are equal then smallest number of inline pushes and if they are equal, then it will just pick one of them.

Created with Ywiki