First you can select whether these functions are applied to the whole tree or whether they only operate on subtrees containing marked species and/or they only operate on visible (i.e. unfolded) parts of the tree.
The default behavior until arb 6.1 was to operate on marked and visible parts only. Due to several, now fixed bugs it did not strictly restrict to these parts while optimizing.
Then you may trigger the wanted optimization/randomization using the following buttons: