Problem.from_formdiagram

classmethod Problem.from_formdiagram(form)

Create a Problem from a FormDiagram.

This is the primary constructor for creating a Problem instance. It initializes all matrices and vectors needed for the optimization from the form diagram.

Parameters:
formFormDiagram

The FormDiagram containing the network geometry, loads, and constraints.

Returns:
Problem

A fully initialized Problem instance with all necessary matrices.

Examples

>>> problem = Problem.from_formdiagram(form)
>>> problem.m  # number of edges
>>> problem.n  # number of vertices