Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Thomas Roy
Problemsquad2
Commits
06cce78c
Commit
06cce78c
authored
May 08, 2017
by
Thomas Roy
Browse files
no approximation we're so good
parent
76e13bb9
Changes
3
Hide whitespace changes
Inline
Side-by-side
check_corner.m
View file @
06cce78c
function
corner
=
check_corner
(
i0
,
i1
,
A
,
y
)
function
corner
=
check_corner
(
i0
,
i1
,
A
,
y
,
inc
)
m
=
size
(
y
,
1
);
C
=
zeros
(
m
);
C
(
1
:
m
-
2
,
1
:
m
-
2
)
=
A
;
...
...
@@ -6,7 +6,9 @@ D = C'+C;
% going from x0 to x1
[
~
,
nodes
]
=
find
(
D
(
i1
,:));
nodes
=
nodes
(
nodes
~=
i0
);
%remove existing edge if it exists
if
inc
==
1
nodes
=
nodes
(
nodes
~=
i0
);
%remove existing edge if it exists
end
j
=
1
;
theta
=
zeros
(
length
(
nodes
),
1
);
for
k
=
nodes
...
...
legal_path.m
View file @
06cce78c
...
...
@@ -35,8 +35,8 @@ for i=1:n+2
corners
=
1
;
else
% check if outgoing nodes are corners
node_corner
=
check_corner
(
i
,
node
,
A
+
A
'
,
x
);
outgoing_corner
=
check_corner
(
node
,
i
,
A
+
A
'
,
x
);
node_corner
=
check_corner
(
i
,
node
,
A
+
A
'
,
x
,
1
);
outgoing_corner
=
check_corner
(
node
,
i
,
A
+
A
'
,
x
,
0
);
corners
=
node_corner
|
outgoing_corner
;
end
...
...
make_plot.m
View file @
06cce78c
...
...
@@ -5,4 +5,17 @@ hold on
G2
=
graph
(
A
+
A
'
);
plot
(
G2
,
'XData'
,
x
(:,
1
),
'YData'
,
x
(:,
2
))
xlim
([
0
,
1
])
ylim([0,1])
\ No newline at end of file
ylim
([
0
,
1
])
%%
figure
plot
(
G2
,
'XData'
,
x
(:,
1
),
'YData'
,
x
(:,
2
));
A_path
=
zeros
(
n
+
2
);
for
i
=
1
:
length
(
path
)
-
1
A_path
(
path
(
i
),
path
(
i
+
1
))
=
1
;
end
hold
on
G3
=
graph
(
A_path
+
A_path
'
);
plot
(
G3
,
'XData'
,
y
(:,
1
),
'YData'
,
y
(:,
2
),
'LineWidth'
,
1.5
,
'EdgeColor'
,
'g'
);
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment