# Graph class

Namespace: [Grasshopper2.Types.Graphs](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.types.graphs.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
[IoId("00000000-829a-4b06-a994-bd151aeb0e37")]
public sealed class Graph : IStorable, IEquatable<Graph>, IComparable<Graph>
```

Represents an immutable graph.

## Constructors

- [Graph](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/ctor.md): (2 overloads)

## Properties

- [Cycles](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/cycles.md): Gets a cached object for finding cycles in this graph.
- [DisconnectedSubgraphs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/disconnectedsubgraphs.md): Enumerate over all disconnected subgraphs that make up this graph.
- [Edges](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/edges.md): Gets the edges of this graph.
- [Length](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/length.md): Gets the combined length of all edges.
- [Nodes](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/nodes.md): Gets the nodes of this graph.

## Methods

- [CompareTo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/compareto.md)
- [Create](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/create.md): (2 overloads, static) Create a graph from nodes and edges with attributes.
- [CreateComplete](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/createcomplete.md): (static) Create a graph by connecting all nodes with all other nodes.
- [CreateFromConvexHull2d](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/createfromconvexhull2d.md): (static) Create a graph based on a 2D convex hull.
- [CreateFromConvexHull3d](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/createfromconvexhull3d.md): (static) Create a graph based on a 3D convex hull.
- [CreateFromMesh](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/createfrommesh.md): (static) Create a graph using the vertices and n-gon edges of a mesh.
- [CreateFromNeighbourhood](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/createfromneighbourhood.md): (static) Create a graph by connecting points to their nearest neighbours.
- [CreateFromSpanningTree](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/createfromspanningtree.md): (static) Create a spanning tree graph from a set of points. Note that spanning trees are usually not unique.
- [CreateFromTesselation](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/createfromtesselation.md): (static) Create a graph from a delaunay triangulation.
- [CreateOrthogonal](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/createorthogonal.md): (static) Create an orthogonal graph with row and column connections.
- [Deform](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/deform.md): Apply a non-linear transformation to this graph.
- [DumpToRhino](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/dumptorhino.md)
- [Equals](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/equals.md): (2 overloads)
- [FindCheapestCosts](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/findcheapestcosts.md): Find the cost of the cheapest route from one node to every other node.
- [FindCheapestRoute](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/findcheapestroute.md): Find the cheapest route between two nodes.
- [FindMinimumSpanningTree](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/findminimumspanningtree.md): (2 overloads, static) A not very performant implementation of a minimum-spanning-tree finder.
- [Format](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/format.md): Format this graph as a block of text.
- [GetHashCode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/gethashcode.md)
- [MakeDirected](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/makedirected.md): Make all edges one-way.
- [MakeUndirected](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/makeundirected.md): Make all edges two-way.
- [Merge](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/merge.md): (static) Merge a set of graphs into a single one.
- [RemoveEdges](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/removeedges.md): (2 overloads) Create a new graph without the indicated edges.
- [RemoveNodes](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/removenodes.md): (2 overloads) Create a new graph without the indicated nodes. This may also affect the edges, as edges may not be left dangling.
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/store.md)
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/tostring.md)
- [Transform](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/transform.md): Apply a linear transformation to this graph.
- [WithoutEdgeAttributes](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/withoutedgeattributes.md): Create a new graph without any edge attributes.
- [WithoutNodeAttributes](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.graphs.graph/withoutnodeattributes.md): Create a new graph without any node attributes.
