ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 07 Jul 2016 19:53:25 +0200Recursive Algorithm for Graph Coloringhttps://ask.sagemath.org/question/34051/recursive-algorithm-for-graph-coloring/In a 2014 article by Exoo, Ismailescu, and Lim ("On the Chromatic Number of R^4"), a recursive algorithm is described that verifies the absence of a proper $k$-coloring of a graph $G$. The authors include only the following description of the algorithm.
"[The program is] based on the following recursive procedure that does an exhaustive search for a $K$-coloring of a graph of order $N$. It employs a global variable *color*, an array of order $N$, which records the color of each vertex $v$ for $1 \leq v \leq N$. The search is initiated with the call DFS(1)."
procedure DFS(v):
Local variable: FCSet - the set of feasible colors for vertex v.
if v > N:
All vertices have been colored, report G is K-colorable.
Exit.
end if
FCSet = {1 ... K}
for u = 1 to v-1:
if u is adjacent to v:
FCSet = FCSet - color(u)
end if
end for
for c in FCSet:
color(v) = c
DFS(v+1)
end for
end procedure
I am having difficulty implementing this algorithm in Sage. Given the nature of the program, I thought Java would be a more natural programming language to use for this algorithm, but I'm afraid I am not familiar with Java syntax.
Any help with implementing this algorithm would be greatly appreciated! JEAThu, 07 Jul 2016 19:53:25 +0200https://ask.sagemath.org/question/34051/Matlab flight simulator display indicator queryhttps://ask.sagemath.org/question/8878/matlab-flight-simulator-display-indicator-query/Hello
I'm working on a flight simulator at the moment within Matlab. I've hooked it up to a joystick and i have great control of yaw, roll, pitch, VTOL, thrust reversers and more! One nice little feature I have made in an m-file is an altitude and speed indicator. These indicators are basically two plots of an outer circle and inner circle and then a dial inside pointing to a value.
The idea is as the aircraft flies, the dial changes indicating speed.
However, I can't quite figure out how to implement this in real time within simulink. I can't use X-Y plots as I require more than one plot on the figure. The needle needs to move simultaneously (or at least with as little delay as possible) with the simulation.
Any help would be greatly appreciated!!!
Justraja13Wed, 11 Apr 2012 23:58:35 +0200https://ask.sagemath.org/question/8878/