java - A Graph data structure with simultaneous node coordinates update -


i exploring efficient way (static) graph data structure allow me easy access node coordinates; given operations involving coordinate data needed, stored in matrix class (for instance, privided n nodes in 2d space, have nx2 matrix).

the initial idea have class node attributes (including x , y coordinates in tuple, example), class graph contain array of node objects, , matrix of coordinates of these nodes. how achieve simultaneous two-direction update of matrix entries , node coordinate entries (whenever touch node 4, 4th row of matrix changes simultaneously :: whenever touch 4th row of matrix, tuple (x, y) of node 4 changes simultaneously)? please feel free propose alternative ways of data representation. understand above may work update method, avoided?


Comments

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -