Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does mathematica support MDS? Or, are there any libraries that support it?

Basically, I have points and a distance function defined between them, and I want to plot them in 2D space, trying to minimize the error (stress) in the distance. This is what MDS does. R has support for MDS, but I can't find similar methods in Mathematica, which I think is strange because this seems like a really common thing to want to do...

share|improve this question
To my knowledge, there's no built-in functionality for this. Google revealed a package to do this, but I have not used it myself. – Szabolcs Jun 17 '12 at 15:17
Thanks, I think this is the answer to the question. – Jose M Vidal Jun 17 '12 at 20:47
Did you try the package? Does it work correctly with version 8? – Szabolcs Jun 18 '12 at 9:52
@Sz Graph embedding in two dimensions is actually MDS in disguise. – whuber Jun 18 '12 at 20:11
Thanks! I didn't know about that. But, there does not seem to be a way to change the edge length (is there?). In my graph some edges would be much longer than others. – Jose M Vidal Jun 18 '12 at 23:06

You might be able to adapt the code in the Multidimensional Scaling demonstration in the Wolfram Demonstrations project.

share|improve this answer
I saw that but, I'm not sure that it works. I tried distances2points[{{0, 1, 1}, {1, 0, 1}, {1, 1, 0}}] and the resulting points do not form an equilateral triangle, as I was expecting. – Jose M Vidal Jun 17 '12 at 17:54

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.