-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double-Check Implementation of Ising Model #26
Comments
If my thoughts for the 1D-Ising should indeed be true, please double-check also the other Ising model implementations. They might exhibit similar issues. |
Hi Thomas, Many thanks for reporting the issue. We will look into this and reply as soon as possible. |
Hi Thomas, many thanks again for reporting this. You are right, all edges are counted twice, so fitness values are doubled. We have revised this and will make notes for the revision with updates. |
Hi. I just took at looked at the updated implementation of the Ising 1D model. If both Notice that in the old code, you had Cheers, |
I just noticed that you are doing the same ( Please take a look. |
If I understand correctly, then the Ising model is defined as follows:
We have a graph where the nodes have the names
1
toN
.These nodes are connected by the set of edges
E
.The "value" of a node
i
be its value in the candidate solutionx
, i.e.,x[i]
.The objective value is the number of edges where both involved nodes have the same value.
This gives us a global optimum at the all-zeros string and the all-ones string.
Roughly speaking, we should have pseudo code like this:
The maximum objective value should be
N
and the minimum objective value should be0
.However, when I look at your implementations of the Ising model, I think -- and I might be wrong, but well, I think -- that you count all edges twice, at least in the 1D version(?)
See, e.g.,
IOHexperimenter/src/Problems/f_ising_1D.hpp
Line 43 in 7b97260
For example, if
n = 3
, then on a 1-D Torus I should have three edges, namely0-1
,1-2
, and2-0
.The optimal objective value should then probably be
3
, I think.However, if I understand correctly, then the loop will go from
i=0
toi=2
and would probably do:This seems to include each index pair twice, and if I have the all-ones string, I should get
6
as result instead of3
.Again: Maybe I misunderstood something elementary here.
Also: From the optimization perspective, this should not really matter.
But it might matter if someone else implements the Ising model, does own experiments, and then wants to compare the results with the output of the IOHexperimenter.
If we want to compare the expected running times to reach certain objective values, then this may lead to a confusion.
Side note 1: I am not sure whether the compiler allows you to do that, but maybe doing
(x[i]==x[j]) & 1
could be a dodgy but fast way to computex[i]*x[j]+(1-x[i])*(1-x[j])
.Side note 2: IOHprofiler/IOHprofiler.github.io#2
The text was updated successfully, but these errors were encountered: