Generating network from normalized distance matrix

83 views
Skip to first unread message

Kayes

unread,
Jul 4, 2016, 11:40:45 AM7/4/16
to visone-users
Hello,

Extremely sorry if there any multiple same posts.

I am a new user of visone and I am trying to learn how to generate network from normalized distance matrix using visone. 

I have to use backbone layout option of visone and I do not insist on
keeping my network connected, retaining only the top 20% of the strongest connections. So, in visone, I tried with following process:

Data format: adjacency list (no directed edge), visualization-> category: layout, layout: node layout,node layout: backbone layout, threshold: percentage (to keep 20%).

However, I couldn't generate the exact network. So, I badly need help with the followings:

1. How to construct the exact network from the normalized distance matrix? Do I need to preprocess the normalized distance matrix to feed into visone so that it can generate the accurate network? If yes, how?
2. How to color and label the nodes of that network automatically (not manually doing for every node)?
3. How can I add legend for that network easily, for example displaying nodes with labels (for different colors) in the bottom of the figure?

I will appreciate if anyone can help me with those questions.

Thank you.

Regards,
Kayes

Arlind Nocaj

unread,
Jul 4, 2016, 3:33:44 PM7/4/16
to visone...@googlegroups.com
On Mon, Jul 4, 2016 at 5:40 PM, 'Kayes' via visone-users
<visone...@googlegroups.com> wrote:
> Hello,
>
> Extremely sorry if there any multiple same posts.
>
> I am a new user of visone and I am trying to learn how to generate network
> from normalized distance matrix using visone.
>
> I have to use backbone layout option of visone and I do not insist on
> keeping my network connected, retaining only the top 20% of the strongest
> connections. So, in visone, I tried with following process:
>
> Data format: adjacency list (no directed edge), visualization-> category:
> layout, layout: node layout,node layout: backbone layout, threshold:
> percentage (to keep 20%).
Note that an adjacency list is not the same as an adjacency matrix.
The adjacency list typically contains only the non zero entries of the
adjacency matrix.

Since you are talking about a distance matrix (which probably is a
square matrix) you should use adjacency matrix. Also make sure you
select the right row and column header option based on your data
format.

>
> However, I couldn't generate the exact network. So, I badly need help with
> the followings:
>
> 1. How to construct the exact network from the normalized distance matrix?
> Do I need to preprocess the normalized distance matrix to feed into visone
> so that it can generate the accurate network? If yes, how?
For filtering I assume that you want to throw out the links with the
largest distances.
The backbone layout uses the given input as a strength (not as a
distance), it thus keeps the, e.g., the 20% links with largest value.
You would thus have to convert the distance measure into a similarity
measure, e.g., similarity=1-distance. You can do this either outside
of visone when writing out you data, or by using the attribute manager
to manipulate link attributes directly.
> 2. How to color and label the nodes of that network automatically (not
> manually doing for every node)?
For the label: Go to attribute manager (the small table in the icon
bar) and select configure. There select the node attribute you want to
have as a label.
For the color use "visualization - mapping - color - node color",
which allows you to map the same color to all nodes or a mix of
colors based on a specified node attribute.
> 3. How can I add legend for that network easily, for example displaying
> nodes with labels (for different colors) in the bottom of the figure?
There is an option in the menu bar: "node - templates" which shows the
set of templates you have. You can add more templates, e.g., based on
the style of a node by selecting a specific node and then right click
on it under properties there is "create template".
>
> I will appreciate if anyone can help me with those questions.
>
> Thank you.
>
> Regards,
> Kayes
>
> --
> You received this message because you are subscribed to the Google Groups
> "visone-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to visone-users...@googlegroups.com.
> To post to this group, send email to visone...@googlegroups.com.
> Visit this group at https://groups.google.com/group/visone-users.
> For more options, visit https://groups.google.com/d/optout.
Message has been deleted

Kayes

unread,
Jul 5, 2016, 10:12:58 PM7/5/16
to visone-users
Thank you very much for the help. I think, the attachment in my previous post is not working. Sorry for the repost.

Actually, as an exercise, I am trying to generate the attached network (L1_network.png) from the attached Normalized distance matrix (L1_Normalized_distance matrix.csv) with backbone layout option of visone and with keeping only the top 20% of the strongest connections but still facing trouble to build the network. 

Could you please suggest steps based on the attached example so that I can construct exactly the same network using the attached normalized distance matrix?
Exercise.zip

Arlind Nocaj

unread,
Jul 6, 2016, 3:31:14 AM7/6/16
to visone...@googlegroups.com
Using your csv file from exercise.zip, I just did the following:


a) reading the input
* open the file: File - open (selecting "CSV files" as type)
* Since your csv file is an adjacency matrix with directed links (no
symmetry on the diagonal) I select the following import options:
data format: adjacency matrix, header, row labels, directed edges, one
mode, cell delimiter "," (see the snappshot).
* Note that since you select directed it means that there are two
links between a pair of nodes, one in each direction.
* The result looks similar to networkA.png.

b) applying the filtering
The backbone layout by default uses the graph structure for filtering
out the links.
If you want to filter based on a specific attribute you have to change
the backbone type: attribute (numeric)
Use the following options in the backbone layout:
* backbone type: attribute (numeric) with link weight: csv value
* connectivity: (deactivated)
* weak links: delete (activated)

and press visualize.
The result should look like networkB (after adding the node labels
under attribute manager). This result is very similar to the one you
gave.
I think the only difference is that the entries in the matrix were not
considered to be directed in your original image. (which since the
entries are not symmetric seem to be an arbitrary/wrong decision).

The width of the edges can be adjusted based on the csv value using:
visualization - mapping - size - link width (attribute: csv value).

The colors of the nodes do seem to be mapped based on an additional
node attribute, or maybe based on a substring of the labeling. You
would have to add such a node attribute and then you can map it to the
node color.


General Comment: Be aware that if your matrix is a distance matrix
(large value means large distance). When you use filtering on a
distance matrix and want to keep 20% of the strongest links, you would
not keep the links with the highest values, but the links with the
smallest values, as a small value denotes a "strong link due to high
similarity".

Hope that helps.
settingsAdjMatrix.png
networkA.png
networkB.png

Kayes

unread,
Jul 9, 2016, 7:41:16 PM7/9/16
to visone-users, arlind...@uni-konstanz.de
Thank you so much. It helped a lot.

Kayes

unread,
Sep 11, 2016, 7:56:05 PM9/11/16
to visone-users, arlind...@uni-konstanz.de
Hi Arlind,

Last time, you helped me to generate a network from a distance matrix where I can keep 20% of the strongest link (zip file is attached). It helped me a lot and thank you so much again.

Just I have one more query, is it possible to get the corresponding distance matrix of the Figure networkB.png (attached) from visone or how can I generate the corresponding distance matrix of Figure networkB.png?

Thank you.

Sincerely,
Kayes


On Wednesday, July 6, 2016 at 12:31:14 AM UTC-7, Arlind Nocaj wrote:
Normalized matrix and network.zip

Arlind Nocaj

unread,
Sep 29, 2016, 5:07:18 AM9/29/16
to visone...@googlegroups.com
Starting from the already filtered network you can do the following:
* File-Export-CSV Files, press save button
* Select the export options for adjacency matrix (see the attached
picture) and press ok

The resulting file looks like the attached "adjaceny matrix.csv".
The value in cell (i,j) is the csv value if there was a link in the
network, or zero if there was no link.

Note that this is not a real distance matrix, as two nodes being in
different components should rather have distance infinity. In case you
want to have another distance, like shortest path distance, you would
first have to apply that analysis (indexing - node distance - shortest
paths) which results in a dyad attribute, which you can then export
again as a distance matrix (from the attribute manager).

On Mon, Sep 12, 2016 at 1:56 AM, 'Kayes' via visone-users
export options.png
adjaceny matrix.csv
Reply all
Reply to author
Forward
0 new messages