minorminer icon indicating copy to clipboard operation
minorminer copied to clipboard

Compare division by zero strategies

Open stefanhannie opened this issue 4 years ago • 0 comments

Division by zero is unavoidable in a vectorized implementation of p_norm since zeros appear along the diagonal of the matrix. There are (at least) two strategies to overcome this:

  1. Catch the numpy division by zero errors and convert the output to nan.
  2. Add some small epsilon along the diagonal so that we no longer have zeros.

Strategy 1. is currently implemented. https://github.com/dwavesystems/minorminer/blob/3c0331f95b64c9513f76ad95e686ea05391ea6f4/minorminer/layout/layout.py#L125 We should compare run-time differences and layout quality differences between the two strategies.

stefanhannie avatar Mar 31 '20 18:03 stefanhannie