MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn moreOpportunities for recent engineering grads.

Apply Today**New to MATLAB?**

The Matlab Semi-Annual Contest Grand Finale is Knots.

This Challenge is to Speed up the Scoring routine that counts the number of Knots.

Details and examples are at Knots Rules.

**Input:** [adjacency xy]

- adjacency is an NxN matrix of topologically adjacent(connected) points
- xy is an Nx2 matrix giving the X and Y coordinates for the N points

**Output:** nKnots; Number of Knots

**Scoring:** Speed; Based on cumulative time of Knots [ 3 6 15 18 24 30 37 42 46 49]; Nominal Time 9.7 sec

Baseline Knot Contest Knot scoring for all 50 test cases is 63 seconds on Cody.

2 correct solutions
4 incorrect solutions

Last solution submitted on Nov 16, 2013

2 Comments

Alfonso Nieto-Castanon
on 16 Nov 2013

not really sure, but perhaps there are some numerical precision issues for some of the near-colinear cases in the testsuite? (if so perhaps it would be useful to resample the testsuite nodes to remove colinear or near-colinear cases?)

Richard Zapor
on 16 Nov 2013

The expected knots table was based upon the Official slow scoring method. The docross function creates many warning messages "Warning: Matrix is singular to working precision. ". A single case, #3, takes >0.3 seconds versus expected 0.01 seconds.

2 Comments