<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to convert an edge list to an adjacency matrix? in SAS/IML Software and Matrix Computations</title>
    <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152919#M1374</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS has a product (&lt;A href="http://support.sas.com/software/products/sna/index.html#s1=1"&gt;SAS Social Network Analysis&lt;/A&gt;) for SNA, but it doesn't use SAS/IML.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you intend to do with the adjacency matrix once you have it?&amp;nbsp; For a matrix that large, the obvious approch is to use a sparse representation, but there are only &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/66845/HTML/default/viewer.htm#imlug_sma_toc.htm"&gt;a small number of matrix operations that are supported for sparse matrices&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For smaller networks, you can use the SUB2NDX function (added in SAS/IML 12.1) to quickly build a (dense) adjacency matrix:&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;nodes = { &lt;/P&gt;&lt;P&gt;3 1,&lt;/P&gt;&lt;P&gt;4 2,&lt;/P&gt;&lt;P&gt;2 3 };&lt;/P&gt;&lt;P&gt;maxNode = max(nodes);&lt;/P&gt;&lt;P&gt;adj = j(maxNode, maxNode, 0);&lt;/P&gt;&lt;P&gt;idx = sub2ndx(dimension(adj), nodes);&lt;/P&gt;&lt;P&gt;adj[idx] = 1;&lt;/P&gt;&lt;P&gt;print adj;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 23 Mar 2014 11:46:47 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2014-03-23T11:46:47Z</dc:date>
    <item>
      <title>How to convert an edge list to an adjacency matrix?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152918#M1373</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Hi all, I'm a beginner using SAS to perform network analysis. The data set is represented as the follows:&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="99" style="border: 1px solid rgb(0, 0, 0); width: 109px; height: 67px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;node 1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: #6690bc; color: #ffffff; padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;node 2&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Each column represents the id of nodes; each row represents an edge from node 1 to node 2.&lt;SPAN style="line-height: 1.5em;"&gt;There are a large amount of nodes, say 200000, Now I want to convert this data set to a 200000 x 200000 adjacency matrix, i.e. each row and each column represents a node, a value 1 is set to row i column j if there is an edge from node i to node j. According to the above table the converted one is like this:&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE border="1" class="jiveBorder" height="124" style="border: 1px solid #000000; width: 154px; height: 117px;" width="152"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TH style="text-align: center; background-color: rgb(102, 144, 188); color: rgb(255, 255, 255); padding: 2px;" valign="middle"&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: rgb(102, 144, 188); color: rgb(255, 255, 255); padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;1&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: rgb(102, 144, 188); color: rgb(255, 255, 255); padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;2&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: rgb(102, 144, 188); color: rgb(255, 255, 255); padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;3&lt;/STRONG&gt;&lt;/TH&gt;&lt;TH style="text-align: center; background-color: rgb(102, 144, 188); color: rgb(255, 255, 255); padding: 2px;" valign="middle"&gt;&lt;STRONG&gt;4&lt;/STRONG&gt;&lt;/TH&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;2&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;3&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;4&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;1&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;TD style="padding: 2px; text-align: center;"&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;SPAN style="line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;&lt;SPAN style="line-height: 1.5em;"&gt;Now my problem is, because the data set is too large, when using SAS IML to create a 200000 x 200000 matrix there is insufficient memory. So I wonder if there is alternatives to create such a big matrix? If it is doable, how could I do it?&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin: 0 0 1em; font-size: 14px; background-color: #ffffff; color: #000000; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif;"&gt;Many thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 22 Mar 2014 10:53:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152918#M1373</guid>
      <dc:creator>onesasuser</dc:creator>
      <dc:date>2014-03-22T10:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert an edge list to an adjacency matrix?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152919#M1374</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;SAS has a product (&lt;A href="http://support.sas.com/software/products/sna/index.html#s1=1"&gt;SAS Social Network Analysis&lt;/A&gt;) for SNA, but it doesn't use SAS/IML.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What you intend to do with the adjacency matrix once you have it?&amp;nbsp; For a matrix that large, the obvious approch is to use a sparse representation, but there are only &lt;A href="http://support.sas.com/documentation/cdl/en/imlug/66845/HTML/default/viewer.htm#imlug_sma_toc.htm"&gt;a small number of matrix operations that are supported for sparse matrices&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For smaller networks, you can use the SUB2NDX function (added in SAS/IML 12.1) to quickly build a (dense) adjacency matrix:&lt;/P&gt;&lt;P&gt;proc iml;&lt;/P&gt;&lt;P&gt;nodes = { &lt;/P&gt;&lt;P&gt;3 1,&lt;/P&gt;&lt;P&gt;4 2,&lt;/P&gt;&lt;P&gt;2 3 };&lt;/P&gt;&lt;P&gt;maxNode = max(nodes);&lt;/P&gt;&lt;P&gt;adj = j(maxNode, maxNode, 0);&lt;/P&gt;&lt;P&gt;idx = sub2ndx(dimension(adj), nodes);&lt;/P&gt;&lt;P&gt;adj[idx] = 1;&lt;/P&gt;&lt;P&gt;print adj;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2014 11:46:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152919#M1374</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-03-23T11:46:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert an edge list to an adjacency matrix?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152920#M1375</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am planning to use the matrix to calculate descriptors such as betweenness, eigenvector, average path length... Because the network is very large and operations on an edge list usually take a very long time, so I was trying to convert it to an adjacency matrix.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About SAS social network analysis, is there a trial version available on SAS website? I looked at the link you mentioned but seems only an introduction about this product is there.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2014 17:49:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152920#M1375</guid>
      <dc:creator>onesasuser</dc:creator>
      <dc:date>2014-03-23T17:49:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert an edge list to an adjacency matrix?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152921#M1376</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right.&amp;nbsp; Thought so.&amp;nbsp; I don't think IML will be able to handle yourfull&amp;nbsp; 200,000x200,000 adjacency matrix.&amp;nbsp; For smaller networks, people have done what you are describing.&amp;nbsp; There were some interesting papers on this at SAS Global Forum and other conferences in the 2012-2013. Do an internet search for&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; iml airport connectivity centrality&lt;/P&gt;&lt;P&gt;and you'll find some papers by Hector Rodriguez-Deniz that you might find interesting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Mar 2014 19:42:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152921#M1376</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2014-03-23T19:42:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert an edge list to an adjacency matrix?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152922#M1377</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. What you want to use is PROC OPTGRAPH - this procedure can calculate all of these decsriptors, uses sparse representations, and scales very well. In order to use PROC OPTGRAPH, you nee da SAS Social Network Analysis (SNA) server license.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no trial version of SAS Social Network Analysis server that I am aware of.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To learn more about what PROC OPTGRAPH offers, you can consult the documentation here:&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/solutions/optgraph/index.html"&gt;http://support.sas.com/documentation/solutions/optgraph/index.html&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 24 Mar 2014 13:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152922#M1377</guid>
      <dc:creator>Matthew_Galati</dc:creator>
      <dc:date>2014-03-24T13:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert an edge list to an adjacency matrix?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152923#M1378</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, I see.&lt;/P&gt;&lt;P&gt;Thank you for the suggestions, though the examples you mentioned used smaller networks, they are very useful. Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 21:36:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152923#M1378</guid>
      <dc:creator>onesasuser</dc:creator>
      <dc:date>2014-03-25T21:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert an edge list to an adjacency matrix?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152924#M1379</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello, thanks for your reply. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Indeed the functions in PROC OPTGRAPH are what I'm looking for. But I guess SNA is only for business use? Because I'm a student so I wonder if it is possible for a student to obtain a server license?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 21:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152924#M1379</guid>
      <dc:creator>onesasuser</dc:creator>
      <dc:date>2014-03-25T21:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert an edge list to an adjacency matrix?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152925#M1380</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Unfortunately, I do not think there are any student licenses for PROC OPTGRAPH.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 13:00:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152925#M1380</guid>
      <dc:creator>Matthew_Galati</dc:creator>
      <dc:date>2014-03-26T13:00:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to convert an edge list to an adjacency matrix?</title>
      <link>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152926#M1381</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ow ok, thanks anyway.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Mar 2014 16:22:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-IML-Software-and-Matrix/How-to-convert-an-edge-list-to-an-adjacency-matrix/m-p/152926#M1381</guid>
      <dc:creator>onesasuser</dc:creator>
      <dc:date>2014-03-26T16:22:45Z</dc:date>
    </item>
  </channel>
</rss>

