<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKGraphNode/connectedNodes",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKGraphNode(py)connectedNodes"
  },
  "title" : "connectedNodes"
}
-->

# connectedNodes

The list of other nodes connected to this node.

```
var connectedNodes: [GKGraphNode] { get }
```

## Discussion

In GameplayKit, the connections between nodes in a graph are directional. For example, if the [`connectedNodes`](/documentation/GameplayKit/GKGraphNode/connectedNodes) list of Node A contains Node B, then a traveler on the graph can move directly from Node A to Node B. For the reverse to also be true, the [`connectedNodes`](/documentation/GameplayKit/GKGraphNode/connectedNodes) list of Node B must contain Node A. To conveniently create connections in both directions, use the `bidirectional` parameter of the [`addConnections(to:bidirectional:)`](/documentation/GameplayKit/GKGraphNode/addConnections(to:bidirectional:)) method.

For more information, see [GameplayKit Programming Guide](https://developer.apple.com/library/archive/documentation/General/Conceptual/GameplayKit_Guide/index.html#//apple_ref/doc/uid/TP40015172).

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)