Algorithm For Dimensionality Reduction Diagram