Tag Archive: edges


The following program reads a set of edges that define a graph and creates a representation of this graph with an adjacency list. The adjacency list of a graph is an array of lists, one for each vertex, where the j-th list contains a linked list of the nodes which are connected with the j-th vertex.

Continue reading

The following program reads a set of edges that define an undirected graph and creates a representation of this graph with an adjacency matrix, giving a[i][j] and a[j][i] the value of 1 if there is an edge from i to j or from j to i in the graph, or the value of 0 if it does not exist. Also, we assume that the number of vertices V is a constant known at compilation time. Otherwise, there should be dynamic memory allocation for the array that represents the adjacency matrix.

Continue reading

This project refers to an Arduino sketch which allows the rotation of three dimensional shapes using appropriate sensors. Essentially, the Arduino collects values from the sensors and corresponds them to the [0, 360] range (rotation angle). Every time we get a pair of values (X, Y) for the rotation of the shape, the pair is sent over the USB serial port to the PC.

The PC runs a Python script which produces three-dimensional shapes with OpenGL. Also, the script obtains the pairs via the USB serial port and renews the current shape of the screen. For performance reasons, the three-dimensional shape is renewed only when there are changes in the pair (X, Y).

Finally, you should know that to run the Python script properly the Arduino should already be running and input sensors should have been calibrated regarding their edges. The calibration is performed automatically in the first 15 seconds (use two potentiometers as an example for both input sensors).

Continue reading