You can use GraphViz
, which is a layout engine for displaying graphs. When specifying an edge, you can give a len
attribute to specify a preferred length. It will try to find a layout that is close possible to your suggestions. There are other GraphViz options like model
that might be relevant as well.
However, you should have low expectations that your arbitrary metric can be embedded into low-dimensional Euclidean space in a way that (approximately) preserves distances. Your data might be unavoidably high-dimensional, and so you simply may not be able to get good results with this approach.