Sunday, 30 June 2019

Gephi: GEXF: Define an edge


<edge> element is used to define an edge in the graph. Each edge must specify source and target endpoints.

And edge have below attributes associated with it.
         a. id  : Uniquely identifies the edge
         b. type : it can be directed (or) undirected (or) mutual
         c. label : Edge label
         d. source :  id of the source node
         e. target : id of the target node
         f. weight : It is a float value
        
Example
<edge id="0" source="0" target="1" weight="2.1" label="Path from A to B" type="directed"/>

HelloWorld.gexf
<?xml version="1.0" encoding="UTF-8"?>
<gexf xmlns="http://www.gexf.net/1.2draft" version="1.2">

   <meta lastmodifieddate="2018-04-05">
      <creator>Hari Krishna</creator>
      <description>Simple graph with two nodes</description>
   <keywords>basic, example</keywords>
   </meta>
   
   <graph>
      <!-- Define nodes here -->
      <nodes>
         <node id="0" label="A" />
         <node id="1" label="B" />
      </nodes>
   
   <!-- Define edges here -->
      <edges>
         <edge id="0" source="0" target="1" weight="2.1" label="Path from A to B" type="directed"/>
      </edges>
   
   </graph>
   
</gexf>



Previous                                                 Next                                                 Home

No comments:

Post a Comment