 @testable import SwiftFusion
 
 /// A factor on two discrete labels evaluation the transition probability
-struct DiscreteTransitionFactor {
+struct DiscreteTransitionFactor : NewFactor {  
+  typealias Variables = Tuple2<Int, Int>
+  
+  /// The IDs of the variables adjacent to this factor.
+  public let edges: Variables.Indices
+
   /// The number of states.
   let stateCount: Int
 

    var (graph, variables) = createSwitchingFactorGraph()
    _ = graph as NewFactorGraph

    XCTAssertEqual(graph.storage.count, 2)

    // optimize
    var opt = LM()

    let movements = [
      Pose2(1, 0, 0),       // go forwards
      Pose2(1, 0, .pi / 4), // turn left
      Pose2(1, 0, -.pi / 4) // turn right
    ]

    var graph = NewFactorGraph()
    graph.store(NewPriorFactor2(x1, Pose2(10, 0, 0)))
    graph.store(NewPriorFactor2(x2, Pose2(11, 0, 0)))
    graph.store(NewPriorFactor2(x3, Pose2(12, 0, 0)))
