Grasshopper

algorithmic modeling for Rhino

Hi guys, I'm trying to convert a given adjacency matrix to a visualised weighted directed graph in rhino and feel a little out of my depth. Does anyone know a way I can do this?

The final result should show something like this image to the right in rhino.

The methodology doesn't really matter, as long as it can be applied to any given adjacency matrix.

If anyone solves this Ill send them some sweets. Cheers!

Views: 6999

Replies are closed for this discussion.

Replies to This Discussion

Hmm ... a million years ago I did this (initially in Fortran, reminds you something?) as part of a cluster analysis that yields topological arrangements.

The adj Matrices were used to "replicate" what we call room schedules in our trade (theoretical/desired relations of proximity between "spaces" for a given AEC project). The fact that spaces have desired sizes as well makes the whole puzzle a bit more challenging. Kinda like the notorious HARNESS hospital design initiative.

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&sou...

Anyway:

The code (mostly inspired by the ideas of Christopher Wolfgang Alexander) is ported in C++ and runs in Unix based old workstations the likes of H/P 9000/370 (good old days). I'll give it a spin for some C# translation (portions of it to be honest) just to indicate the whole approah.

But leaving aside theories of fuzzy sets and cluster analysis ... in your case doing a "graph" from a given adj matrix is rather simple (I'll post a small C# example soon).

In the mean time:

http://stackoverflow.com/questions/15306040/generate-an-adjacency-m...

http://stackoverflow.com/questions/18882779/how-to-get-adjacency-ma...

http://www.rkinteractive.com/blogs/SoftwareDevelopment/post/2013/06...


HIGHLY recommended reading:

http://www.amazon.com/Data-Structures-Algorithms-Using-C/dp/0521670152

I was ready to include some demo Adj thingy to this ... but then started thinking some weird ideas (related with the "presentation" of that "matrix") and ... anyway ... get a "labeling" demo (TextDots display the Math.Round(Line.Length,2) but you get the gist, I do hope) whilst the trad V2 update (+ Adj) is on the making.

BTW: In what type of collection are your data sampled? (List of List, Tree, Matrix, Bird, Plane, Superman, what?)

1M Q: Can we replace sweets with some proper spirit(s)?

best, Peter

Attachments:

Found a couple of minutes to "finish" the V2 (using Matrices).

WOW stuff postponed (until my Stoli Elite arrives, in one piece). Of course V3 does a lot more stuff ... but ... er ... hmm ... programming is a spiritual thing (literally).

have fun, best, Peter

Attachments:

hahaha wow yeah this is amazing, Thank you soo much for this! 

Yes inbox me the address you want me to send too and Ill get right on your spirits request! 

About the context..

I'm trying to apply a adjacency matrix to a courtroom for a school assignment. I wanted to create a system using a hierarchy of sightline variables such as the judge to the witness being more important then the witness support to the security guard if you get what I mean. Architects do this now but its a little impractical the methods they use. 

Based on what you have given me, Im going to try and make a fitness function using Galapagos  which will input parameters such as the necessary position of stationary members such as the judge to the end of the courtroom and having the various members face(to one side) the judge. 

Hmm ... you don't need Galapagos for that: you need a classic cluster analysis.

https://www.google.com/url?sa=t&rct=j&q=&esrc=s&sou...

Why may you ask? Well ..read first and we talk later (Plan B: Skype).

PS: " ...Architects do this now... " : No I'm afraid they don't. The only thing that the vast majority does is blobs that look like buildings and buildings that look like blobs.

BTW: This is what happens when intentions and ability mismatch (rather significantly).

Verdict: Apparently some trivial bugs in the cluster analysis, what else? > Tip > fix lines N0, N567 and N1345 (Object reference not set to an instance ... blah, blah).

Get this V2A in case that you want to VISUALIZE which girl dates what boy - case asymmetric Matrices (it's just a guideline: not implemented in the main code ... but you speak C# don't you?).

Attachments:

I've gotta touch up on my C# but yes I can read it fine. 

Thanks again for all your help!

They do... to a certain extent, Its just the way they do it is really bad. 

Dem Architects are like "Err herp, lets draw some circles and place the camera at what we think is the position of the viewer and see whats happening and try and match what we want to be seen which who can see who".

There really isn't much science in their methodology and so it became a bit of an interest for me, not that I've been to court that much myself. 

I wanted to be really specific in what is created, is for a courtroom. 

Yeah I'm gonna try and read through it tonight. Ill message when I'm finished with any questions. 

They do eh? well ... if you insist, he he (Ignorance is a bliss).

Note: the Event Horizon of all things (read this 666 times and then re-read):

http://www.amazon.com/Notes-Synthesis-Form-Harvard-Paperbacks/dp/06...

BTW: On purpose (in order to raise considerably [I do hope] the Vodka quantity) I haven't mentioned the core of the matter: by what means you think that you could interactively fill-up that Adj Matrix? (or the equivalent DataTree).

Answers to: The Lord, District 9, North Pole.

BTW: V2B does this (I feel a bit thirsty).

heres the matrix mock up. 


Hmm ...

1. I do hope that you are in the Nth iteration with regard the Bible of all AEC analysis things (I'll examine your progress with a couple of "simple" questions soon).

2. I haven't mentioned from the start ... but the weighted directed graph is TOTALLY useless for translation "demands" into topology. In fact, what you actually need is a dendrogram derived from that Matrix: say a hard HAC type of dendrogram. Bad news are that this type of stuff (a very powerful thingy in the right hands) ... well it's classified as internal and I can't post the code for that type of stuff.

3. Other than that, get the V2B that deals with that classic puzzle: how to interactively modify items in collections. Although in this occasion we are after a simple DataTree/Matrix ... with a bit of imagination ... you'll understand what this actually means, he he.

4. Provide your mail : it's (maybe) time for Chapter2 of the Aurora Project (a humble paper of mine dealing with ... er ... any other business, he he).

PS: All my top C++ (Unix) gurus have contributed for the code described in this paper:

Attachments:

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service