DESIGNING SCREEN LAYOUT IN MULTIMEDIA APPLICATIONS THROUGH INTEGER PROGRAMMING AND METAHEURISTIC

Binding audiovisual content into multimedia applications requires the specification of each media item, including its size and position, to define a screen layout. The multimedia application author must plan the application’s screen layout (ASL), considering a variety of screen sizes where the application shall be executed. An ASL that maximizes the area occupied by media items on the screen is essential, given that screen space is a valuable asset for media broadcasters. In this paper, we introduce the Application Screen Layout Optimization Problem, and present its NP-hardness. Besides, two integer programming formulations and an Iterated Local Search (ILS) metaheuristic are proposed to solve it. The efficiency of the proposed methods is evaluated, showing that the metaheuristic achieves better results and is at least 12 times faster, on average, than the mathematical formulations. Also, the proposed approaches were compared to a layout design algorithm, showing their effectiveness. Mathematics Subject Classification. 90-05. Received April 12, 2021. Accepted October 18, 2021.


Introduction
In multimedia applications an application's screen layout (ASL) consists of the disposition of visual content on the screen. It is usually defined by indicating the position of each media item relative to the screen, where for each media item its attributes are set in relation to the screen top-left corner. In general, languages enable the application author to define such values either in pixels or percentage [1].
The multimedia application author, usually a content producer, has to plan the ASL and, possibly, consider a variety of screen sizes where the application shall be executed. Analyzing different interactive multimedia applications transmitted in real applications and/or stored in an application repository called Clube NCL [7], we can find presentation characteristics common to most. It was noticed that the media objects were arranged using a grid structure to determine candidate positions. These structure is important because all the media objects arrangement use these points as candidates to create the application layout. Although several tools have been used to rearrange media objects on a screen [3,9,10], whether on the smartphone or television, these techniques are not intended to create an optimized layout. The literature's known tools do not guarantee that the layout produced will be maximized concerning the display screen's occupation. Since an ASL that maximizes the area occupied on the screen by media items is essential, due screen space is a valuable asset for media broadcasters, in this paper, we introduce and study the Application Screen Layout Optimization Problem (ASLOP), the problem of finding an ASL (a subset of items and their positions) from a set of media items that, when distributed on the screen, maximize the occupied area and avoids overlap of items. This problem is especially difficult when the number of media items to be distributed on the screen grows. Its description is as follows.

Input:
A large rectangle (the application screen) with integer dimensions, a set of smaller rectangles (set of media items) also having integer dimensions, and a set of points within the screen forming a grid (candidate central points of media items) where the distance between consecutive points of on the -axis and the -axis are not necessarily the same.

Goal:
Find a subset of pairs ( , ), ∈ , ∈ (media items and their center's position) which fits inside the screen, maximizing the covered area of without overlapping items. Figure 1 illustrates an application's screen layout obtained from a set of media items for a screen with a grid of central points . Following the typology defined in [38], from a combinatorial optimization point of view, ASLOP can be categorized respectively as (i) two-dimensional, since it considers both axes and ; with a (ii) strongly heterogeneous assortment, since there are many items of many different shapes or sizes; it has (iii) one large object (the screen); and (iv) regular small items, given that media items are rectangles.

Application Screen Layout Optimization Problem
In fact, ASLOP fits in the Cutting and Packing class of problems. Cutting and Packing (C&P) is a class of optimization problems with a wide range of applications in resource management, such as wood or glass industries, warehousing context, newspaper paging and, most recently, web browser layout [13,38,39].
In particular, ASLOP is closely related to widely studied optimization problems such as Two-dimensional knapsack, Rectangle Packing, and Guillotine Cut problem.
Although there are several problems related to fitting rectangles within a larger one, due to the constraints concerning the grid of central points, none of these classical problems correctly model the Application Screen (B) an optimal solution for ASLOP considering only media items having the same shape.
Layout Optimization Problem. The classical problems do not consider that each rectangle in the solution needs to be assigned to a candidate center. Once this characteristic is clear, it is not difficult to verify that ASLOP behaves differently than Two-dimensional Knapsack, Rectangle Packing, and Guillotine Cut problem, for example. Figure 2 shows that a solution for Rectangle Packing as well as Twodimensional Knapsack may not be a solution for ASLOP.
In addition, Figure 1 shows that a solution for ASLOP, may not be a solution for the Guillotine Cut Problem as well as Figure 2 illustrates that an optimal solution for Guillotine Cut Problem may not be a solution for ASLOP.
Therefore, one may conclude that although ASLOP belongs to the same class of problems such as Twodimensional Knapsack, Rectangle Packing and Guillotine Cut Problem, none of them can be used to solve ASLOP. Other researches that work with problems similar to ASLOP can be found in [4,6,11,18,19,23,36]. However, given its specific characteristics, previous techniques may not be directly applied to solve it.
Motivated by its real applicability in the area of Webmedia, as well as its challenging combinatorial nature from the point of view of the Optimization field, in this paper, we analyze the complexity of the ASLOP problem as well as develop tools to solve it. First, we prove that the problem is -hard then, from a parameterized complexity perspective, we show that the problem is fixed-parameter tractable with respect to the area to be covered. Next, we present two integer programming formulations. Moreover, considering the limitations of the two proposed integer programming formulations to find high quality solutions and prove optimatility, an Iterated Local Search (ILS) metaheuristic was also proposed to solve the ASLOP. The efficiency of both formulations and the ILS was evaluated and compared through the analyzes of the covered area for several data sets.
The remaining of this paper is organized as follows. Section 1.1 presents the problem's motivation inspired by multimedia applications and related works to solve the applied problem in practice. Section 2 shows an hardness proof for ASLOP, and present a kernelization algorithm which allows us to observe that the problem is fixed-parameter tractable (ℱ ) concerning the area to be covered by the media items as parameter. Section 3 presents two integer programming formulations to solve ASLOP and an ILS metaheuristic. Section 4 presents experiments using the proposed formulations and a comparison between them. Finally, Section 5 concludes this paper and presents future work.

Motivation and related works
The multimedia production pipeline for digital TV and IPTV includes steps from the planning of the audiovisual content to be presented, their capture and binding into an application latter deployed to the spectator [5]. Binding audiovisual content into a multimedia application is usually performed using specific domain languages, such as HTML5 (HyperText Markup Language) [33], SMIL (Synchronized Multimedia Integration Language) [32] and NCL (Nested Context Language) [20]. Those languages focus on presenting audiovisual content, such as videos, audios, and images, synchronized in time and distributed along the exhibition device screen. Recently, some languages are able to provide synchronization between audiovisual content and sensory effects [27].
Initiatives such as Hybrid broadcast broadband TV (HbbTv) [17] and Integrated broadcast-broadband systems [21] indicates that Digital TV marketplace is an interesting research area. In this scenario, some studies such as [24,25] present that broadcasted television shows are becoming more interactive allowing even home viewers to be part of them. Therefore, interactive TV applications with enjoyable layouts are desirable for users.
Many research attempts to address the designing of screen layouts in multimedia applications in different ways. One approach is to provide authoring tools to ease the creation of the ASL, such as [3,9,10], where tools are proposed to represent media items and enable the author to rearrange such medias in the tool interface. Once the ASL is created, the tool generates the corresponding code in the language used for the application creation.
CSS Flexible Box Layout enables the author to define a region on the screen (called flex container and flex items) composed of a set of spatial properties, such as direction, wrap, and justify-content, and alignment [34]. It focuses on space distribution in a primary axis using a bottom-up approach to arrange items. It can also use a content-sizebased line-wrapping system to control its secondary axis. CSS Grid Layout controls the sizing and positioning of regions and their contents [35]. Unlike CSS Flexible Box Layout, it works considering the arrangement of items in both dimensions. Using CSS Grid Layout authors can adapt the ASL to changes in the presentation device, such as factors, orientation, and available space. It combines CSS media queries with CSS properties that control the disposition of the grid container and its children during a presentation.
Adaptive layouts are templates where the author defines the ASL by means of predefined arrangements, such as grids and flows 1 [1]. At processing time, media items are distributed on the screen according to the chosen arrangement definition, such as its size, its items size and so on. Such approach works associating media items with a given layout arrangement (grid or flow) in the order they are declared in the document. Therefore, while rendering the layout, presentation characteristics are created according to the number of media items associated with each layout arrangement, following a similar approach to CSS [35].
Depending on the approach used for providing an adaptive layout, some media items may not be displayed because the screen size was not sufficient to accommodate them. W3C [34,35] requires the presentation of all available items on the available screen. When the available screen area is not sufficient for presenting all items, it does not provide a solution. Amorim et al. [1] creates a partition considering the media item's order in the document. CSS uses scroll bars to enable the presentation of all media items.
Although several tools have been used to rearrange media objects on a screen, whether on the smartphone or on television, these techniques are not intended to create an optimized layout. These tools do not guarantee that the layout produced will be maximized in relation to the occupation of the display screen.
To summarize, we propose tools to support multimedia application authors to create an ASL that maximizes the occupied area on the screen, thus solving the ASLOP. We follow an alternative approach where we neither use the order of media items declared in the document to create the spatial arrangement nor create media item partitions when the available space is not sufficient to accommodate them all [1]. Instead, the proposed approach uses integer programming formulations to choose media items that maximize the occupied area. Some media items may not be displayed because the screen size was not sufficient to accommodate them. However, it is possible to perform a second round to choose the next subset of media items to be displayed.
From a practical standpoint, the rational use of the screen becomes even more relevant during the COVID-19 pandemic, since most parts of the daily activities are being performed online. These activities are diverse, including from e-commerce to home-office. As a result, platforms used to work meetings grew vertiginously: Google Hangout, for instance, grew to 60% daily in March, while Zoom jumped from 10M to 220M users from 12/2019 to 03/2020 [28].
Regarding trade, according to a Brazilian report about Economy and Consumption during the pandemic, although the Trade Sales Index of Brazilian Retailer registered 25.1% retraction in the same month of the previous year, the e-commerce has grown 32.6% in the number of orders [28]. Then, considering that the maximization of the screen use could promote a more significant number of ads incentivizing e-commerce, this research becomes relevant to help, albeit indirectly, in the marketing and sales areas.

Computational complexity
Once having explained the importance of ASLOP to the field of study and the applied area, it is necessary to show the difficulty in solving it, which combined with its relevance, would justify our study.
Theorem 2.1. The Application Screen Layout Optimization Problem is -hard.
Proof. The proof uses a reduction from the Subset Sum problem, shown to be NP-hard by [22]. In Subset Sum we are given elements, { 1 , . . . , } and a target . We are asked to determine whether there is a subset of elements which adds up exactly to . Let us consider an instance of Subset Sum, formed by a finite set , such that | | = and each ∈ is an integer greater than zero. Moreover, consider a positive integer. From this instance we construct an instance of ASLOP as follows: -create a rectangular screen of dimension 1 × ; -for each ∈ , create a rectangular media item of dimension 1 × ; Now, consider the bottom-left and top-right corners of the screen at points (0, 0) and (1, ) of the Cartesian space: -Let be the grid formed starting at the point (0, 0) in such a way that the distance between consecutive points of on the -axis as well as the -axis is 0.5, and the top-right point is (1, ).
Since, by construction, the height of the screen and of all media items are equal to 1, it is easy to see that there is a subset ⊆ with ∑︀ ∈ = if and only if there is a subset of media items that occupy the entire screen area.
If the reader feels more comfortable having elements with both height and width of non-unitary value, to modify the proof, just create a media of size + 1 × , where = ∑︀ ∈ (the sum of the values in ), and is the target value of Subset Sum. In addition, we make the screen size equal to + 2 × , and increase the grid proportionately. In this way, a solution occupying the entire screen will exist if and only if, in addition to using the media of size + 1 × , there is a set of medias that correspond to a Subset Sum solution.
As shown in Theorem 2.1, the problem remains NP-hard even when both the screen and the input medias have height equal to one. Next, we present an analysis of the relationship between the complexity of the problem and the size of the solution. More precisely, we show that the problem is fixed-parameter tractable concerning the size of the solution as parameter. More details on Parameterized Complexity can be found in [8] and [12].
Theorem 2.2. The problem of determining whether there is a set of media items that cover an area of size at least of the application screen without overlapping them is fixed-parameter tractable when parameterized by .
Proof. Considering the problem of determining whether there is a solution covering an area of size at least (the size of the solution to be found), a kernel can be obtained by applying the following reduction rules: (1) Remove all media that do not fit the screen; (2) If the sum of the remaining items areas is less than , return No; (3) If any remaining item has an area of size at least , return Yes.
If Rules 2 or 3 were applied then the problem was solved. Otherwise, the number of different media items shapes is bounded by 2 . Since the height/width of the medias are integers, a minimal set of media covering an area of size at least contains no more than items. Therefore, the following reduction rule can be safely applied. (4) For each media item shape remove all but items. Now, the number of remaining media items is bounded by 3 . (5) If the distance between consecutive points of on the -axis (as well as the -axis) is greater than , contract it to by applying a directional scaling. Note that if on a given axis the distance between any two points on the grid is at least , then there will be no overlap with respect to that axis, since the area of each item is less than and the points of the grid are central positions. Thus, contraction up to is safe. (6) Similarly to the previous rule, we reduce up to 2 (if necessary) the distance between the edges of the border of to the bottom-left and top-right points of the grid. Finally, it remains to apply the last reduction rule: (7) If the screen has a height or width greater than 2 2 − , return Yes.
The safety of Rule 5 follows from the fact that all the remaining media items fit the screen and have a height and width less than . Note that 2 is a safe distance between two central points on the same line as 2 is a safe distance from a central point to the border. Thus, if the height of the screen is greater than 2 2 − then we can insert it into the screen, in a top-down manner, the remaining media of greater area. Analogously, if the width of the screen is greater than 2 then we can insert on the screen, in a left-right manner, the remaining media of greater area.
After applying the reduction rules above, we either assert Yes or No to the decision problem, or we conclude that the screen has a height and width less than 2 2 − and return an instance with at most 3 smaller media items composing a polynomial-sized kernel for the problem.
Since a problem is ℱ if and only if it has a kernel (see [12]), the claim holds.
Theorem 2.2 shows that if the threshold size of the desired area to be covered is small then the problem can be efficiently solved.

Tools to solve ASLOP
The ASLOP presents several difficulties in its modeling and solving. First of all, if each possible coordinate inside the screen is a candidate to be the center of a media, the non-overlapping constraints would necessarily be non-convex constraints, which is not a good thing when working with integer programming problems [37]. In order to avoid that kind of situation, it was decided to use a discretization of the screen, creating a grid where each point would be a center candidate. Figure 3 represent this idea for a 3x3 grid.
Considering that each media item ∈ has an associated width and height ℎ , the generated grid has its points created using and ℎ , which are, respectively, the smallest width and the smallest height of the candidate media items.
This means that after centering the origin (0, 0) in the upper-left corner of the screen, every candidate center can be found through the expression (ℎ 1 Having defined the grid and consequently a set of possible centers, the two integer programming formulations can be defined.
The remainder of this section is organized as follow: Subsection 3.1 presents the first formulation proposed, called Distance Formulation. In Subsection 3.2, a second integer programming formulation based on the independent set problem [31] is presented. At last, Subsection 3.3 presents the soft computing techniques.

Distance formulation
Let . and . be defined as the x-coordinate and y-coordinate of center ∈ . Through a preprocessing procedure, one can create sets ( ) which contains all media items that may be centered in center without trespassing the borders of the screen. Following the same idea, it is possible to define ( ) as the set of all possible centers for media item , for whom the border of the screen is not trespassed if is placed in center . In order to verify whether an overlapping happens, given ,¯∈ , ∈ ( ) and¯∈ (¯) whenever the following expressions hold true, items and¯cannot be placed at centers and¯simultaneously: where . , . ,¯. and¯. can be defined as: The relations described by equations (3.3) and (3.4) can be seen graphically in Figure 4.
To facilitate the notation lets create the function ( ,¯, ,¯) that returns if both equations (3.3) and (3.4) are true, otherwise, false. At last, let ∈ {0, 1}, ∀ ∈ , ∀ ∈ ( ), be a decision variable associated to the media item ∈ and center ∈ , which represents whether media item is placed in center . Having defined all the necessary elements, the ASLOP can be formulated as an integer programming problem as follows.  The objective function (3.7) states the maximization of the sum of the chosen media items' area. In this function, is the area of a rectangle. Constraints (3.8) ensure that no overlapping is allowed between chosen media items. Constraints (3.9) ensure that each center can have assigned to it at most one media item . Constraints (3.10) ensure that one media item can be used at most one time in the solution. At last, Constraint (3.11) define the domain of the decision variables.

Independent set formulation
In order to use this formulation one must build a conflict graph [2] = ( , ), such that each vertex ∈ is associated to a pair ( , ) and has a cost = , where remains the area of a rectangle. In this graph, given two vertex ∼ ( , ) and ∼ (¯,¯), whenever at least one of the expressions ( ,¯, ,¯), or =¯, or =¯is true, an edge ( , ) is added to . Let ∈ {0, 1} | | be decision variables which represent whether a vertex is in the solution. Once this graph was build and the decision variables were defined, another integer programming formulation to represent the ASLOP can be defined as follows.  (3.14) The objective function (3.12) states the maximization of the sum of the chosen media item's area. Constraints (3.13) ensure that overlapping and multiple use of the same media item is not allowed. At last, Constraints (3.14) define the domain of the decision variables.

Soft computing techniques
In this section an Iterated Local Search [26] to solve the ASLOP is presented. This subsection is organized in such way that the following three subsection present the components of the ILS and the last one present how these components are combined in the proposed approach.

Constructive heuristic
Soft computing techniques are being used to deal with many layout optimization problems [16,40]. The constructive heuristic applied here uses the black-box LocalSolver framework 2 , which has been used successfully in covering problems [16]. The LocalSolver framework has a hybrid approach of neighborhood search, which allows it to combine different optimization techniques in a dynamic way during the resolution process. As described in their website, this framework may combine local search techniques, constraint propagation and inference techniques, linear mixed-integer programming techniques, as well as non-linear programming techniques. Since it is a black-box, how these techniques are combined is not available to general public.
Given a valid representation of the problem, the black-box LocalSolver framework applies several techniques in order to find high quality solutions. In this paper, the Independent Set Formulation (as described in Sect. 3.2) was used as a representation of the problem in the LocalSolvers' API for C++. This was done since the Independent Set Formulation provided better results than the ones obtained when using Distance Formulation together with LocalSolver. An important remark is that, since LocalSolver is dependent of the representation used, a better representation may lead to better solutions. In the following sections, LSH is used to refer to the use of LocalSolver as a constructive heuristic.

Perturbation
The perturbation, defined as a component of the proposed ILS, consists in adding a new item or removing an item from the solution . In order to decide whether the addition ( ) or the removal ( ) will be used, a random number between zero and one is generated. If this number is smaller than or equal to the threshold the removal happens, otherwise the addition procedure is selected. When there is no media item to be removed, removal procedure cannot be performed. So instead of removal, an addition procedure is selected. When most of the region is covered by multiple media items and no more can be added, a media item is removed executing the removal procedure. The perturbation, called , is described in more details in Algorithm 1. In Algorithm 1, the methods RemoveItem( ) and AddItem( ), receives a solution and return whether it was possible to make the movement. If it was possible, the AddItem returns the new solution, otherwise RemoveItem returns a new solution.

Local search
In order to improved a given feasible solution, a Local Search heuristic is applied. The local search used in the proposed ILS uses as neighborhood all solutions that have exactly one item different from the current explored solution. Mathematically speaking, the neighborhood of a solution ∈ , where is the solution space, can be define as: where ( , ′ ) represents the number of different elements between these two solutions.
Having defined that, the local search procedure may be represented by Algorithm 2.  Algorithm 2 receives as a parameter a feasible solution and tries to improve it by swapping one item in the solution with another one that is not in the solution. In order to do that, it verifies all feasible solutions ′ in the current neighborhood and move to the best one. In order to verify feasibility, the function (¯, , ) is used. The function (¯, , ) verify whether it is possible to exchange items and . After verifying feasibility, Algorithm 2 verifies whether the cost of the this solution is better than the current best one. This calculation is done through function ( ) = ∑︁ ∈ , which receives a solution as parameter and returns the covered area.
At last, after completely exploring the neighborhood, the (., ., .) function is called, in order to move to the newly best solution found, if one was found ( = true). This procedure repeats until no further improvement can be done.

Iterated local search -ASLOP
The Iterated Local Search (ILS) [15,26,29], is a metaheuristic that repeatedly applies local search procedures to solutions obtained by perturbing previously visited local optimal solutions. The ILS presented here uses as its components the LSH presented in Section 3.3.1, the Local Search and Perturbation presented in Sections 3.3.3 and 3.3.2, respectively. The methods are applied in a straightforward way. First we run the LSH to get a feasible solution. Secondly we try to improve the quality of the previously found solution by applying the Local Search and the Perturbation. So, the algorithm is described in Algorithm 3. In the proposed ILS, the initial solution is generated by the LSH method. Then, the LocalSearch function performs the local search procedure and the AddDrop performs a perturbation. The UpdateBest, is responsible to store the best solution found.

Computational experiments
This section presents computational experiments on the formulations presented in Sections 3.1 and 3.2, and the ILS described in Section 3.3.4. Experiments considered four common screen sizes (640 × 480, 800 × 600, 1024 × 768 and 1920 × 1080) and five sets of media items (containing 14, 20, 28, 34 and 42 media items) with different dimensions to be distributed along the screen. Thus, 20 ASL instances were created for each combination of screen size and media item quantity.
Each ASLOP instance contains 64% of small media items and 36% of big media items. Small and big media items are created considering a base size calculated as a function of the screen size and considering a grid composed by 10, 15, 20, 25 and 30 media items, respectively. One should notice that the number of media items generated for each ASL instance is approximately 40% higher than the grid size so that the formulation has to choose among the available media items.
Let be the base size in a given dimension (width or height), the size of a small media item in that dimension is given by 0.7 · + (0.6 · ). That means that small media items are generated with sizes that are in the proximity of the base size by a factor of 30%. Moreover, let be the screen size in a given dimension, the size of a big media item in that dimension is given by + ( − ). That means that big media items have its size between the base size and the screen size. All generated instances are available at https://github.com/oca-cefetrj. This section is organized as follows. The first subsection presents and analyze the results obtained by both mathematical formulations. The second subsection presents the results obtained by the proposed ILS and compare them with the results obtained by the mathematical formulation.

Mathematical formulation experiments
Both formulations were implemented in C++ and compiled with g++ 7.2.0 using the -03 optimization flag. The experiments were carried out on an Intel(R) Core i7-7740X CPU 4.30GHz machine with 32GB of RAM. For the implementation and execution of the formulations, CPLEX Studio 12.8 framework was used with its cuts, pre-processing and heuristics disabled. A one-hour processing time limit was determined and no parallel option of the processor was activated. Table 1 presents the results obtained by the mathematical formulations. The first column (Instance) presents the name of the instance. Columns (BSF -Best Solution Found) and (Time), respectively, present the coverage, in percentage, obtained by the mathematical formulation and the CPU time in seconds spent to prove optimality (or reach the time limit). Column (GAP) present the final GAP obtained by CPLEX. The last line presents the average of columns Time and GAP. Whenever column GAP presents a dash ("-"), it means that the mathematical formulation was not able find a feasible solution.
Analyzing Table 1, one can verify that the Distance Formulation was able to find a coverage over 70% in all the instances, except by 640 480 5 and 1920 1080 1 (whose the coverage was 66.34% and 69.42%, respectively). The Independent Set Formulation, by its turn, had a worse performance: it has not found a feasible solution in six out of twenty instances. Nevertheless, the other instances achieved a coverage index over 70%. In average, the Distance Formulation achieved a cover of 76.065% of the screen, while the Independent Set Formulation was able to find a cover, in average, of just 51.366%. Now, analyzing the average computational time spent by the methods, it is possible to verify that both methods had a similar performance stopping when the time limit was reached (3600 s). In this case, Distance Formulation took less time to solve the problem to all number of media (ranging from 1.54 to 18.61 times faster). Nevertheless, even using the whole time available, the Independent Set has not found a feasible result when adopting a larger number of media items. The Distance Formulation was, on average, 200 faster than the Independent Set Formulation. In two cases, instances 640 480 5 and 1021 780 4, the Distance Formulation had its process stopped because the process reached the maximum RAM capacity. Nonetheless, even in this case, the Distance Formulation was able to find better coverage than the Independent Set Formulation. It is interesting to remark that the Independent Set Formulation was not able to find a single feasible solution for 6 out of 20 instances.
From a theoretical point of view, both formulations are strictly the same since one can map each variable to one variable . Constraints (3.8) are in Constraints (3.13), while Constraints (3.9) and (3.10) are stronger version of Constraints (3.13) ∖ Constraints (3.8). Considering that, one may verify that the relaxation of Distance Formulation is tighter than the other.

ILS experiments
The proposed ILS was implemented in C++ and compiled with g++ 7.2.0 using the -03 optimization flag. The experiments were carried out on the same machine presented in Section 4.1. After testing different values for , {0.35, 0.5, 0.75}, we chose = 0.5. As for the stopping criterion, the number of iterations was 100, after testing {50, 100, 150, 200, 250}. Table 2 is organized in such way to show the coverage of solution of the constructive phase (LS), the coverage of the best solution found by ILS (BSF), the average coverage obtained by ILS (AvgSol), the standard deviation for the obtained solutions (StdSol), the average time spent in seconds (AvgTime) and the standard deviation for the computational time (StdTime).
It is possible to note that the coverage of the ILS ranges from 69.423% to 85.678%, achieving an average coverage of 79.102%, which is better than the average solution found by the Distance and Independent Set formulations. It is also possible to note that the standard deviation is small, which shows that the ILS seems to be a stable method.
In order to improve the analysis, Table 3 shows the results of the comparison between the ILS and the mathematical formulations. Columns GAP DF and GAP ISF show the GAP of the the average solution found by the ILS in relation to the solutions obtained by the Distance Formulation (GAP DF) and the Independent Set Formulation (GAP ISF).
The GAP was calculated using the solution obtained by one of the mathematical formulations (MFsol) and the solution of ILS (ILSsol). equation (4.1) define how the GAP was computed: In addition, the column Time DF shows the quotient between the computational time spent by Distance Formulation (Time DF) and the ILS; while the column Time ISF shows the quotient between the Independent Set Formulation (Time ISF) and ILS.
The experimental results presented in Table 3 indicates that the proposed ILS not only was able to find, in average, better solutions than the mathematical formulations, but also was, in average, 12 times faster than the Distance Formulation and 13 times faster than the Independent Set Formulation. By comparing ILS with DF, the two methods with better performance, it was possible to realize that ILS had a better coverage in eleven out of twenty cases, being tied in seven of twenty. Regarding the time, ILS is faster in sixteen out of twenty instances. In the four instances that ILS is slower, the coverage is the same in two of them and it is worse in the other two).
Another comparison can be seen in Figure 5, where the average solutions obtained by the ILS are compared with the best solutions found by the two mathematical formulations. Figure 5 is a comparison, presenting three dimensions, first the transparence that represents the best solution, the opaque color presents the average solution and the time is represented by the width of the section. This representation shows how fast the ILS Figure 5. ILS vs. best solutions found by the mathematical formulations.
is in comparison to the formulations and how ILS is close and yet better in solution quality to the Distance Formulation.
It is worth mentioning that grids bigger than 5 × 5 are uncommon in digital TV applications, as well as media items smaller than 20% of the screen size. Given that the proposed solution was able to provide results for all the experimental scenarios, it points to the possible use of the ILS in real-world scenarios, e.g., for defining a TV program ASL.
It is the technique used by the main tools for building multimedia applications. The technique is simple to facilitate the application author, who is usually not an experienced programmer.
In order to improve the study, we compared the ILS against a technique for positioning media objects used by the main tools for building multimedia applications [1,27]. This technique is widely used in multimedia applications because it is simple which is called Arrangement in Order (AiO). The operation of the AiO is described as follows: the media objects that will be positioned on the display screen are declared in a text file. This file is analyzed, and each media object is evaluated in the order in which it was declared. The technique tries to position the first analyzed media object in the first available center. The centers are traversed from right to left and from top to bottom. If possible, both the media object and the center are marked as used and move on to the next media object. If it is impossible to place the media object in that center, a next available center is sought. This action is done until there are no more available centers or media objects to allocate.
The Figure 6 shows the comparison between the ILS and the AiO technique. The metric used for the comparison was the area covered by the media objects.
It is possible to notice that the ILS metaheuristic wins in all instances with significant differences. This situation was already expected since the aim of the ILS is to optimize the covered area. However, it is possible to note that the AiO technique depends a lot on how media objects are declared. The average coverage of the AiO technique is approximately 48%, while ILS has an average of 79% coverage. The average difference found between the approaches is approximately 31%, a significant value. It is noticed that the use of the ILS heuristic enhances the use of the space for presenting media objects resulting in a benefit that cannot be disregarded by content providers.

Conclusions and future works
Binding audiovisual content into a multimedia application in the production pipeline of digital TV and IPTV require authors (usually content producers) to specify for each media item its size and position when defining the application screen layout. This process requires much authoring effort since the author has to plan the ASL and consider a variety of screen sizes. Besides, it is important to maximize the area occupied on the screen, given that screen space is a valuable asset for media broadcasters. We called this problem as Application Screen Layout Optimization Problem (ASLOP). This paper proposed a new approach to deal with (ASLOP) and its applications for digital TV and IPTV. A formal definition for ASLOP and its proof of -hardness was provided. A kernelization algorithm which allows us to observe that the problem is ℱ concerning the area to be covered by the media items as a parameter is also presented. In addition, two integer programming formulations and a metaheuristic were presented to solve ASLOP: the Distance Formulation, the Independent Set Formulation and the ILS metaheuristic. All methods were tested with different screen sizes and number of media items to be distributed along the screen. The computational cost and time spent were presented for each method.
The computational experiments showed that, in practice, the Distance Formulation outperformed the Independent Set Formulation. The Distance Formulation found better solutions than the Independent Set Formulation for 12 out the 20 instances and an equal solution in 7 out the 20 instances. Now comparing the formulations with ILS, one may verify that the ILS outperformed the mathematical formulations in 10 out the 20 instances, tied in 9 out the 20 instances and lost in just one. In addition it is important to remark that, in average, the ILS was at least 12 times faster than the mathematical formulations.
In addition, it was possible to show that the ILS heuristic has a much better covered area rate than the AiO technique, normally used by multimedia applications for building layouts. ILS demonstrated an average coverage rate of 79% versus 48% for the AiO technique.

Future works
Future researches could focus on strengthening the formulations and developing efficient cutting-plane algorithms, so a branch and cut technique could be developed. Considering the structure of the problem, one may focus on using clique cuts to do the above proposed. It is also possible to combine the ILS with the formulations in a way to improve the starting solution generating a positive effect on branch and bound and branch and cut prunes', decreasing the computational time. In order to do combine heuristics and exact methods investigating hybrid methods that combine exact methods, meta-heuristics and data mining seems to be a suited path to pursue [14,16,30].
Also recalling that ASLOP generalizes classical combinatorial optimization problems like Subset Sum and Knapsack, and as shown in Theorem 2.1, the problem remains NP-hard even when both the screen and the input media have some of the dimensions equal to one. This implies that combinatorial explosions are inherent in solving the problem, even for instances that intuitively should be "easy", for example, instances with simplified shapes (i.e., having both media and media items with just one dimension). To try to unravel characteristics that make instances of the problem difficult, we should go into deeper computational complexity issues. More precisely, there is a branch of Computing Theory called Parameterized Complexity Theory that aims to map the parameters that are sources of the intractability of a problem. An analysis of the Parameterized Complexity of ASLOP is also a potential future work.

Some generalizations of the problem
As one can see, the ASLOP problem is a simple version of the real problem having three structural restrictions: fitting in the screen dimension, overlap avoidance, positioning items in candidate central points of the given grid. Having said that, several variants could be proposed. The first one, instead of considering the area coverage, one must decide that it should be interesting to weigh the media and maximize the summation of the weight of the used items instead of maximizing the covered area. Note that ASLOP is a particular case of this problem where the weight of each item corresponds to its area. This variant can be explained when different enterprises have different marketing budgets and are willing to pay different amounts for their advertising. Recall that one can handle this variant using the methods proposed in this paper.
One possible second variant would deal with conflict sets of items, where items from such sets are not allowed together in the solution. This can be easily seen whenever two competing brands decide to try to advertise on the same platform. In other words, in addition to the screen , the set of media items , and the grid , we are given sets 1 , 2 , . . . ℓ of items and asked to find a conflict-free solution for the problem where | ∩ | ≤ 1 for each 1 ≤ ≤ ℓ, representing that a solution contains at most one item by a group of conflicting elements. To deal with this variant, both presented mathematical formulations will need one more constraint for each conflict set. These constraints will ensure that at most one item in the set is selected. From the ILS perspective, to adapt it to this variant, one should keep an auxiliary data structure to remove/add candidates whenever one item of a conflict set is selected or removed from the current solution.
Another path to pursue consists of considering multiple media with different shapes, for example, rectangular and circular media altogether, which leads to the necessity of adjustments in equations (3.3) and (3.4). Besides these adjustments, the proposed methods are also able to deal with this variant.
Another point that may be investigated as future work is the choice of the centers as well as considering that the candidate centers are not positioned according to a grid.