# Error in displaying the layout of a graph obtained from vmtkNetworkExtraction

**URL:** https://discourse.vtk.org/t/error-in-displaying-the-layout-of-a-graph-obtained-from-vmtknetworkextraction/3139
**Category:** Support
**Created:** [April 24, 2020, 3:45am UTC](https://discourse.vtk.org/t/error-in-displaying-the-layout-of-a-graph-obtained-from-vmtknetworkextraction/3139 "2020-04-24T03:45:28Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Deepa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/deepa/32/1680_2.png) [@Deepa](https://discourse.vtk.org/u/Deepa)
#### Post date: [April 24, 2020, 3:45am UTC](https://discourse.vtk.org/t/error-in-displaying-the-layout-of-a-graph-obtained-from-vmtknetworkextraction/3139/1 "2020-04-24T03:45:28Z")

</div>

Hi All,  
I’m referring to the examples available [here](https://lorensen.github.io/VTKExamples/site/Python/Graphs/ConstructGraph/) to display a graph .  
The graph has been obtained from the following code and the input file is available [here](https://github.com/DeepaMahm/misc/blob/master/vesseltree.stl).

```
reader = vmtkscripts.vmtkSurfaceReader()
reader.InputFileName = 'vesseltree.stl'
reader.Execute()

networkExtraction = vmtkscripts.vmtkNetworkExtraction()
networkExtraction.Surface = reader.Surface
networkExtraction.Execute()
network = networkExtraction.Network
graph = networkExtraction.GraphLayout

graphLayoutView = vtk.vtkGraphLayoutView()
graphLayoutView.AddRepresentationFromInput(graph)
graphLayoutView.ResetCamera()
graphLayoutView.Render()

```

Error:

```
ERROR: In ..\Common\ExecutionModel\vtkExecutive.cxx, line 784
vtkCompositeDataPipeline (00000268620B50A0): Algorithm vtkGraphLayout(000002686195AA90) returned failure for request: vtkInformation (0000026861AE69E0)
  Debug: Off
  Modified Time: 121696
  Reference Count: 1
  Registered Events: (none)
  Request: REQUEST_DATA_OBJECT
  FORWARD_DIRECTION: 0
  ALGORITHM_AFTER_FORWARD: 1
  FROM_OUTPUT_PORT: 0

```

I want to display the graph and also display the node labels and edge labels and also add edge weights .  
Also, I’d like to know how to obtain the topology information of the graph i.e incidence/adjacency matrix and degree of the nodes in the nodes from VTKArray/vtkPolyData

Any suggestioons will be really helpful.

---

<div class="post-metadata">

### Author: ![lassoan](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lassoan/32/50_2.png) [@lassoan](https://discourse.vtk.org/u/lassoan)
#### Post date: [April 24, 2020, 3:13pm UTC](https://discourse.vtk.org/t/error-in-displaying-the-layout-of-a-graph-obtained-from-vmtknetworkextraction/3139/2 "2020-04-24T15:13:51Z")

</div>

If you don’t get any answer here then please try posting to the VMTK mailing list instead.
