• No results found

The Development of an Application for Art Gallery Planning

N/A
N/A
Protected

Academic year: 2022

Share "The Development of an Application for Art Gallery Planning"

Copied!
7
0
0

Loading.... (view fulltext now)

Full text

(1)

The Development of an Application for Art Gallery Planning

Mikael Fridenfalk Masaki Hayashi Leo Sandberg

Department of Game Design, Uppsala University

{mikael.fridenfalk, masaki.hayashi, leo.sandberg} (at) speldesign.uu.se

Abstract

A system is presented for the algorithmic placement of, for example, artworks in a gallery, based on an arbitrary number of predefined categories by which each artwork can be numerically appraised. By the provision of a weight value for each category set by a visitor, a personalized experience is thus created that effects the placement of the artworks. To verify the system, a 3D simulation environment was built to enable the visitor to experience the personalized art gallery. The algorithm for artwork placement was based on a simplified version of a nearest insertion algorithm, providing for an approximate solution of the traveling salesman problem, with the objective to either minimize the differences between the exhibited artworks along the path, or to invoke a predefined amount of variation between the artworks.

1 Introduction

The Traveling Salesman Problem (TSP) [3], is one of the most popular problems within computer sci- ence, associated with many methods for approximate solutions, but also with exact solutions, however in the general case considered to be computationally too expensive for practical applications [1]. A common case of TSP consists of the evaluation of the mini- mal route through M cities on a 2D map, where each city is only visited once, and where the cost to travel from one city to another is defined as the regular (also known as the Euclidean) distance between the cities.

This paper presents a system for the placement of works of art in a gallery based on (1) the appraisal of each artwork within any predefined category by, e.g., a curator, along with (2) the setting of a weight value for each category by the visitor, depending on the preference on the significance of each category.

TSP is often suggested as a viable method for the calculation of personalized paths in physical muse- ums [2, 16], given a gallery of a certain predefined configuration. We could however not find any work where TSP was used for the placement of the art- work itself. Since TSP seems to be considered for the

calculation of the physical path along predetermined positions in, e.g., art museums, where the actual se- quence by which each artwork is visited is of minor importance, the method presented in this paper solves rather the reverse problem, namely given the physi- cal positions in advance, e.g., how artworks may be placed for a personalized experience.

Although the new method presented in this paper in theory can be used for instance by a curator for the automatic placement of artworks, it is however pri- marily intended for use in a virtual art gallery or mu- seum, to enable the visitor to walk through the gallery in a virtual 3D environment without the need of phys- ical presence, time pressure [7], or from the perspec- tive of the curator, in the case of highly valuable art- works, without the risk of possible degradation of the artworks.

2 Proposal

This paper proposes a method for the arrangement of, for instance, artworks in a gallery, where a predeter- mined route for the visitor already exists. An exam- ple of such route is presented in Figure 1. Here, each wall section has been labeled by a number, marking

(2)

the estimated sequential order by which the artworks are expected to be visited.

1 2

3

4 5

6

7

8 9

10 11 12

13 14 15

16 17

18 19

20 21

22

23

24

25 26

27 28

29 30

31

32 33

34 35 36

37 38 39

40

Figure 1: Configuration of gallery section.

The proposed method consists of the application of a TSP model, based on the assignment of values to each artwork, contingent of at least two independent variables (since the use of one variable would reduce the problem into a sorting problem). The variables, or in this context, categories (or more specifically, in a mathematical context, spatial dimensions, translat- ing the problem into an N -dimensional TSP), yields an M × N matrix, here denoted as U, where M des- ignates the number of artworks, synonymous with the number of cities in TSP, or the number of nodes in graph theory, and where each element umn in U, in the nominal case, is expected to be assigned a per- centage value between 0 and 100.

Regarding the distance function in our TSP model, given the Euclidean distance in RN:

DN = v u u t

N

X

n=1

(∆xn)2 (1)

the distance between two cities, i and j, is in our pro- posed model defined as:

dist(i, j) =

v u u t

N

X

n=1

wn· (uin− ujn)2

− c

(2)

where c denotes the distance offset, which by default is set to zero. If a constant amount of variation is preferred instead of minimization of the differences between the artworks along the path, c may be set to a higher value. The coefficient wn denotes the

weight assigned to each category by the visitor, i.e., totally N weight values, preferably each set to a value not smaller than 0.1 or larger than 10, depending on the significance of the category. As a higher weight value wn increases the distance between the nodes (along the n:th dimension of the N -dimensional TSP model), the result is that while change comes easier (along the path) to categories with lower weight val- ues, change is applied more gradually to categories assigned higher weight values. However, at imple- mentation, wn may for the purpose of optimization be used at a preprocessing stage, by the application of umn ← wn· umn, for all cities, to relocate the cities accordingly, thereby eliminating the need for the ex- plicit incorporation of wnin (2).

Regarding the categories themselves, a few exam- ples by which each artwork may be numerically ap- praised follows as: (1) physical (coloring, size, com- position, etc.) [14], (2) thematic, (3) emotional, (4) psychological, and (5) historical (from the point of art history). Such categories require however, in gen- eral, some level of expertise for accurate numerical estimations. A more detailed example of how cate- gories may be selected, and artwork values assigned and scaled, is presented in Section 4.

3 Implementation

The application was developed and implemented in C++ using OpenGL [12], Simple DirectMedia Layer (SDL 2.0) [15] and Xcode [18].

3.1 Virtual 3D Environment

Each wall section (here defined as a place holder for a single artwork), is dimensioned 3 × 3 meters. The gallery section used in the 3D simulation experiments is presented in Figure 1. The camera in the virtual en- vironment is, in a visitor mode, positioned at the ex- pected height of the sight of the visitor. All measure- ments in the simulation environment are designed to be accurate compared to the real world. The exhibited paintings are thus displayed by their accurate size, ob- tained in millimeters by the application, to which all images are rescaled. The paintings are loaded into the application in jpg-format, and for high performance, internally saved and rendered as textures, using the graphics memory. The 3D system enables user con-

(3)

void TSP::InsertionSearch(int M){

for (int c = 0; c < M; c++){

double d, p = 1e50; int a, b, m = 0;

for (int i = 0; i < c; i++){

a = mPath[i], b = mPath[(i+1)%c];

d = dist(a,c) + dist(b,c) - dist(a,b);

if (p > d){p = d; m = i;}

}

for (int i = c - 1; i > m; i--) mPath[i+1] = mPath[i];

mPath[m+1] = c;

};

};

Figure 2: The implementation of a simplified version of the Nearest Insertion Algorithm.

trol in two modes: a visitor mode for nominal walk around in the gallery, and an examination mode, pri- marily intended for taking a closer look at 3D art- works.

3.1.1 Visitor Mode

In the visitor mode, the user is able to walk in the 3D gallery in the same way that most 3D-based com- puter games enable motion. The keys W-S-D-A cor- respond to forward/backward motion, versus rotation to right/left. Similarly, dragging the mouse while holding the left mouse button pressed, enables rota- tion up/down (camera tilt), versus right/left (camera pan).

3.1.2 Examination Mode

In the examination mode, the user is able to right- click the mouse button on any point in the 3D sys- tem, which by this action will be assigned as the new look-at position, defining the direction of the camera from the point of the view of the user. This method is based on the inverse calculation of 3D projections in the scene, depending on the mouse cursor location on the screen, using the depth buffer in OpenGL to evaluate the requested position in 3D. Zooming is in this context performed by dragging the mouse by the right mouse button. Rotation of the scene around the look-at position, up/down (camera tilt) and left/right (camera pan), is additionally performed by dragging the mouse by the left mouse button.

3.2 TSP Algorithm

The algorithm that was developed for the approximate solution of TSP in this work, showed to be in practice identical to one proposed in [8]. As a note on com- putational costs, the average complexity is O(n2), which is not untypical for relatively concise algo- rithms for approximate solutions of TSP. A slight up- date to this algorithm was suggested a few years later, called the Nearest Insertion Algorithm [13], which in addition played a role in the assignment of the work- ing name “Insertion Search” for the implemented al- gorithm in this work.

In the Nearest Insertion Algorithm, at each stage, a Hamiltonian circuit containing a subset of the nodes (synonymous with cities in TSP) is built up, and a new node is inserted into the circuit between two ad- jacent nodes. Given the distance function, dist(i, j), between any two nodes, i and j, the algorithm may according to the original formulation be expressed as follows:

1. Start with a subgraph consisting of a single node, say node i.

2. Find a node k, such that dist(i, k) is minimal.

Add this node to the subgraph, and construct a Hamiltonian circuit (for the subgraph) consisting of two occurrences of the edge (i, k).

3. Given a Hamiltonian circuit containing a subset of the nodes, find the uncontained node k clos- est to any contained node, i.e., find a minimal dist(m, j) such that node m is in the circuit and j is not, and take k = j.

(4)

4. Given k, find an edge (i, j) in the Hamiltonian circuit for the subgraph such that dist(i, k) + dist(k, j) − dist(i, j) is minimal. This can be in- terpreted as finding a place in the circuit where node k can be inserted at minimum cost.

5. Given k and the edge (i, j), obtain a new Hamil- tonian circuit by replacing edge (i, j) with edges (i, k) and (k, j).

6. If there are any remaining nodes not in the Hamiltonian circuit, go to step 3. Otherwise, the algorithm is finished.

The TSP algorithm implemented in this paper was de- veloped independently of the one in [8], and the Near- est Insertion Algorithm [13] (and similar formulations of the Nearest Insertion Algorithm, such as in [5]), partly in context with the development of an assign- ment selector for the automatic generation of exami- nation papers in discrete mathematics [6], in principle to maximize the difference between subsequent as- signments, from one examination to another, belong- ing to the same assignment category.

Although the algorithm suggested in [8], is similar to the Nearest Insertion Algorithm, the main differ- ence is that this algorithm accepts any node, k, out- side the Hamiltonian circuit in step 3 (according to above), as demonstrated in Figure 2, which while still effective, provides for a concise implementation. In- sertion Search is greatly similar to Insertion Sort [4], which also inserts, not a presorted, but in principle an arbitrary node (or in this context element) k, during each loop. Given the distance dist(i, j) between any two nodes, i and j, and a vector declared in C++, that represents the outcome of the algorithm after execu- tion (as shown in Figure 2):

int mPath[MAX_CITIES];

The TSP algorithm implemented in this work may thus briefly be expressed as follows:

1. Given a vector, select the third element (i.e., in- dex 2), and build a Hamiltonian circuit by the selection of the first three nodes (i.e., the nodes with index 0, 1, and 2).

2. Select the next vector element, and denote it as k. Add node k to the Hamiltonian circuit, by

the replacement of the edge (i, j) with (i, k) and (k, j), in such way that dist(i, k) + dist(k, j) − dist(i, j) is minimized, where i and j denote any two adjacent nodes in the circuit.

3. Stop when all nodes have been inserted into the Hamiltonian circuit, otherwise go to step 2.

In Figure 2, dist(i, j) is defined by (2), and the percent sign (%) designates the mod operator. Briefly put, the rationalization behind the presentation of the imple- mented code in for instance C++, is that as a principal rule, it simplifies the implementation and the testing of the code by the reader, particularly in the case of algorithms where small errors in the pseudocode may be difficult to detect.

Figure 3: Example of a 2D TSP application with 300 cities, using a simplified version of the Nearest Inser- tion Algorithm.

4 Experiments

The main experiments were performed in three steps.

In a first step, the implemented TSP algorithm was verified. An example of such verification in a 2D case with 300 cities is presented in Figure 3, where the starting point of the algorithm is marked by a slightly enlarged dot. In a second step, the basic functionali- ties of the 3D graphics simulation system was verified by the use of enumerated paintings.

In a third and final step, a wide range of paintings were considered [9, 17], and among these, 40 paint- ings from the years 1400 to 1780 were selected from the Kress Collection [10,11], as shown in Figures 4-5.

(5)

Figure 4: The virtual 3D environment for walk-around in the personalized gallery.

Four categories were selected: size, year, portrait and religious factors (many paintings in the Kress Collec- tion consist of Christian motifs), and each painting was assigned a numerical value based on either data retrieved from the US National Gallery of Art [11], or personal estimations.

In the case of production year, defined as the first category, the following formula for an artwork, i, was used, to linearly map each production year, yi, to a value between 0 and 100%:

ui,1 = 100 · yi− ymin

ymax− ymin (3) where yminand ymaxdenote the earliest work versus the latest. In the case of size, defined as the second category, the square root of the area, ai, of each paint- ing was used:

ui,2 = 100 ·

√ai−√ amin

√amax−√ amin

(4) As a note, the areas of the paintings showed to range between 0.059 - 4.7 m2. In the case of the portrait and

the religious factors, the estimations were performed directly in a scale from 0 to 100%. The portrait factor denotes in this context the extent by which a painting is focused on the depiction of a person. The assigned value was thus 100% for a painting with a sole fo- cus on a person, and 0% for the depiction of a motif without one, such as an artifact or a sole landscape.

Similarly, for the religious category, a purely religious motif was assigned the value of 100%.

In addition to the experiments above, as a comple- mentary note to the average complexity of the algo- rithm implemented in this work, which as previously noted is O(n2), speed trials showed that for 100 trial runs of the algorithm for each parameter setting, the average execution time (on a single core of a 2.66 GHz Intel Core i7 processor) was for two categories, estimated to 78 µs for 40 cities and 4.10 ms for 300 cities (such as in Figure 3). For five categories, the corresponding average execution time was estimated to 145 µs for 40 cities and 6.02 ms for 300 cities.

(6)

Figure 5: Visitor mode.

5 Conclusion

The new method suggested in this paper for the au- tomatic placement of, e.g., artworks in a gallery (to either assist the curator, or to create a personalized experience for the visitor), showed in a few exper- iments to work correctly, by either minimization of the change in the assigned values of each category for each artwork along the predefined path, or in the gen- eration of a sequence of artworks with a predefined amount of variation along the path.

The algorithm for approximate solution of TSP, developed in this work (and here called “Insertion Search”, due to great similarities with the sorting al- gorithm Insertion Sort), was found to be in practice identical to one in [8]. Implemented in C++, this al- gorithm showed to be concise. In computer science as well as in mathematics, brief solutions are as a rule preferred to complex ones, which is applicable to this work, where the accuracy of such solution is not con- sidered to be a significant issue.

References

[1] D. L. Applegate, The Traveling Salesman Prob- lem: A Computational Study, ISBN 978-0-691- 12993-8, Princeton University Press, Princeton, 2006.

[2] L. Aroyo, Y. Wang, R. Brussee, P. Gorgels, L.

Rutledge, N. Stash, Personalized Museum Ex- perience: The Rijksmuseum Use Case, Proceed- ings of Museums and the Web 2007, Archives &

Museum Informatics, San Francisco CA, USA, April 2007.

[3] N. L. Biggs, E. K. Lloyd, R. J. Wilson, Graph Theory 1736-1936, ISBN 978-0-19-853916-2, Clarendon Press, Oxford, 1986.

[4] A. Drozdek, Data Structures and Algorithms in C++, 4th ed., ISBN 978-1-133-60842-4, Cen- gage Learning, 2012.

[5] Y. Fang, G. Liu, Y. He, Y. Qiu, Tabu Search Algorithm Based on Insertion Method, Pro- ceedings of the IEEE International Conference

(7)

on Neural Networks and Signal Processing, pp. 420-423, Nanjing, China, December 2003.

[6] M. Fridenfalk, System for Automatic Genera- tion of Examination Papers in Discrete Math- ematics, Proceedings of IADIS International Conference on e-Learning 2013, IADIS Multi Conference on Computer Science and Informa- tion Systems, pp. 365-368, Prague, Czech Re- public, July 2013.

[7] M. Hayashi, S. Bachelder, M. Nakajima, A New Virtual Museum Equipped with Automatic Video Content Generator, Proceedings of Cy- berworlds 2014, pp. 377-383, Santander, Spain, October 2014.

[8] R. L. Karg, G. L. Thompson, A Heuristic Ap- proach to Solving Travelling Salesman Prob- lems, Management Science, vol. 10, no. 2, pp.

225-248, 1964.

[9] F. S. Kleiner, C. J. Mamiya, Gardner’s Art Through the Ages, 12th ed., ISBN 978-0-15- 505090-7, Thomson Wadsworth, 2004.

[10] Kress Foundation. http://www.kressfoundation.

org. Accessed: 2015-03-30.

[11] National Gallery of Art, USA. https://images.

nga.gov/en/page/show_home_page.html.

Accessed: 2015-04-06.

[12] OpenGL, Silicon Graphics International Corp.

https://www.opengl.org. Accessed: 2015-04-24.

[13] D. J. Rosenkrantz, R. E. Stearns, P. M.

Lewis, Approximate Algorithms for the Travel- ing Salesperson Problem, Proceedings of IEEE 15th Symposium on Switching and Automata Theory, pp. 33-42, New Orleans, USA, October 1974.

[14] L. Sandberg, Imagine: Creating Art for Enter- tainment, ISBN 978-91-633-3664-5, FabPics, 2009.

[15] SDL. https://www.libsdl.org. Accessed: 2015- 04-27.

[16] A. Smirnov, N. Shilov, A. Kashevnik, Context- Oriented Knowledge Management for Intelli- gent Museum Visitors Support, Proceedings of Third International Conference on Advances in Future Internet, pp. 120-125, Nice, France, Au- gust 2011.

[17] B. Wands, Art of the Digital Age, ISBN 978-0- 500-28629-6, Thames & Hudson, 2007.

[18] Xcode, Apple Inc. https://developer.apple.com/

xcode/. Accessed: 2015-04-27.

References

Related documents

The increasing availability of data and attention to services has increased the understanding of the contribution of services to innovation and productivity in

Av tabellen framgår att det behövs utförlig information om de projekt som genomförs vid instituten. Då Tillväxtanalys ska föreslå en metod som kan visa hur institutens verksamhet

Generella styrmedel kan ha varit mindre verksamma än man har trott De generella styrmedlen, till skillnad från de specifika styrmedlen, har kommit att användas i större

I regleringsbrevet för 2014 uppdrog Regeringen åt Tillväxtanalys att ”föreslå mätmetoder och indikatorer som kan användas vid utvärdering av de samhällsekonomiska effekterna av

Parallellmarknader innebär dock inte en drivkraft för en grön omställning Ökad andel direktförsäljning räddar många lokala producenter och kan tyckas utgöra en drivkraft

Närmare 90 procent av de statliga medlen (intäkter och utgifter) för näringslivets klimatomställning går till generella styrmedel, det vill säga styrmedel som påverkar

I dag uppgår denna del av befolkningen till knappt 4 200 personer och år 2030 beräknas det finnas drygt 4 800 personer i Gällivare kommun som är 65 år eller äldre i

På många små orter i gles- och landsbygder, där varken några nya apotek eller försälj- ningsställen för receptfria läkemedel har tillkommit, är nätet av