<｜begin▁of▁sentence｜>### Instruction:
Given a 2D point with coordinates (3, 4), can you compute the squared length of the vector from the origin (0, 0) to this point using a custom Point class and also using NetworkX to compute the squared length between two nodes in a graph, considering the distance (weight) from the origin to the point as the length of the vector?
### Response:
from networkx import Graph
import networkx as nx

class Point:
    def __init__(self, x, y):
        self.x = x
        self.y = y

    def sq_length(self):
        return self.x**2 + self.y**2

# Create a point
point = Point(3, 4)

# Print the squared length of the point from the origin
print('Squared Length:', point.sq_length())

# NetworkX equivalent - compute the squared length between two points (nodes) in a graph
G = nx.Graph()
G.add_edge('origin', 'point', weight=5)
length_squared = nx.single_source_dijkstra_path_length(G, 'origin')['point'] ** 2
print('Squared Length from NetworkX:', length_squared)
<|EOT|>
