-
NRevisit: A Cognitive Behavioral Metric for Code Understandability Assessment
Authors:
Gao Hao,
Haytham Hijazi,
Júlio Medeiros,
João Durães,
Chan Tong Lam,
Paulo de Carvalho,
Henrique Madeira
Abstract:
Measuring code understandability is both highly relevant and exceptionally challenging. This paper proposes a dynamic code understandability assessment method, which estimates a personalized code understandability score from the perspective of the specific programmer handling the code. The method consists of dynamically dividing the code unit under development or review in code regions (invisible…
▽ More
Measuring code understandability is both highly relevant and exceptionally challenging. This paper proposes a dynamic code understandability assessment method, which estimates a personalized code understandability score from the perspective of the specific programmer handling the code. The method consists of dynamically dividing the code unit under development or review in code regions (invisible to the programmer) and using the number of revisits (NRevisit) to each region as the primary feature for estimating the code understandability score. This approach removes the uncertainty related to the concept of a "typical programmer" assumed by static software code complexity metrics and can be easily implemented using a simple, low-cost, and non-intrusive desktop eye tracker or even a standard computer camera. This metric was evaluated using cognitive load measured through electroencephalography (EEG) in a controlled experiment with 35 programmers. Results show a very high correlation ranging from rs = 0.9067 to rs = 0.9860 (with p nearly 0) between the scores obtained with different alternatives of NRevisit and the ground truth represented by the EEG measurements of programmers' cognitive load, demonstrating the effectiveness of our approach in reflecting the cognitive effort required for code comprehension. The paper also discusses possible practical applications of NRevisit, including its use in the context of AI-generated code, which is already widely used today.
△ Less
Submitted 25 April, 2025;
originally announced April 2025.
-
Globally Optimal Boresight Alignment of UAV-LiDAR Systems
Authors:
Smitha Gopinath,
Hassan L. Hijazi,
Adam Collins,
Julian Dann Nathan Lemons,
Emily Schultz-Fellenz,
Russell Bent,
Amira Hijazi,
Gert Riemersma
Abstract:
In airborne light detection and ranging (LiDAR) systems, misalignments between the LiDAR-scanner and the inertial navigation system (INS) mounted on an unmanned aerial vehicle (UAV)'s frame can lead to inaccurate 3D point clouds. Determining the orientation offset, or boresight error is key to many LiDAR-based applications. In this work, we introduce a mixed-integer quadratically constrained quadr…
▽ More
In airborne light detection and ranging (LiDAR) systems, misalignments between the LiDAR-scanner and the inertial navigation system (INS) mounted on an unmanned aerial vehicle (UAV)'s frame can lead to inaccurate 3D point clouds. Determining the orientation offset, or boresight error is key to many LiDAR-based applications. In this work, we introduce a mixed-integer quadratically constrained quadratic program (MIQCQP) that can globally solve this misalignment problem. We also propose a nested spatial branch and bound (nsBB) algorithm that improves computational performance. The nsBB relies on novel preprocessing steps that progressively reduce the problem size. In addition, an adaptive grid search (aGS) allowing us to obtain quick heuristic solutions is presented. Our algorithms are open-source, multi-threaded and multi-machine compatible.
△ Less
Submitted 27 February, 2022;
originally announced February 2022.
-
Convex Hull Formulations for Mixed-Integer Multilinear Functions
Authors:
Harsha Nagarajan,
Kaarthik Sundar,
Hassan Hijazi,
Russell Bent
Abstract:
In this paper, we present convex hull formulations for a mixed-integer, multilinear term/function (MIMF) that features products of multiple continuous and binary variables. We develop two equivalent convex relaxations of an MIMF and study their polyhedral properties in their corresponding higher-dimensional spaces. We numerically observe that the proposed formulations consistently perform better t…
▽ More
In this paper, we present convex hull formulations for a mixed-integer, multilinear term/function (MIMF) that features products of multiple continuous and binary variables. We develop two equivalent convex relaxations of an MIMF and study their polyhedral properties in their corresponding higher-dimensional spaces. We numerically observe that the proposed formulations consistently perform better than state-of-the-art relaxation approaches.
△ Less
Submitted 29 July, 2018;
originally announced July 2018.
-
Complex Number Formulation and Convex Relaxations for Aircraft Conflict Resolution
Authors:
David Rey,
Hassan Hijazi
Abstract:
We present a novel complex number formulation along with tight convex relaxations for the aircraft conflict resolution problem. Our approach combines both speed and heading control and provides global optimality guarantees despite non-convexities in the feasible region. As a side result, we present a new characterization of the conflict separation condition in the form of disjunctive linear constr…
▽ More
We present a novel complex number formulation along with tight convex relaxations for the aircraft conflict resolution problem. Our approach combines both speed and heading control and provides global optimality guarantees despite non-convexities in the feasible region. As a side result, we present a new characterization of the conflict separation condition in the form of disjunctive linear constraints. Our formulation features one binary variable per pair of aircraft, is free of trigonometric functions, and captures the non-convexity in a set of quadratic concave constraints. Using our approach, we are able to close a number of open instances and reduce computational time by up to two orders of magnitude on standard instances.
△ Less
Submitted 18 September, 2017; v1 submitted 20 March, 2017;
originally announced March 2017.
-
Convex Relaxations for Gas Expansion Planning
Authors:
Conrado Borraz-Sanchez,
Russell Bent,
Scott Backhaus,
Hassan Hijazi,
Pascal Van Hentenryck
Abstract:
Expansion of natural gas networks is a critical process involving substantial capital expenditures with complex decision-support requirements. Given the non-convex nature of gas transmission constraints, global optimality and infeasibility guarantees can only be offered by global optimisation approaches. Unfortunately, state-of-the-art global optimisation solvers are unable to scale up to real-wor…
▽ More
Expansion of natural gas networks is a critical process involving substantial capital expenditures with complex decision-support requirements. Given the non-convex nature of gas transmission constraints, global optimality and infeasibility guarantees can only be offered by global optimisation approaches. Unfortunately, state-of-the-art global optimisation solvers are unable to scale up to real-world size instances. In this study, we present a convex mixed-integer second-order cone relaxation for the gas expansion planning problem under steady-state conditions. The underlying model offers tight lower bounds with high computational efficiency. In addition, the optimal solution of the relaxation can often be used to derive high-quality solutions to the original problem, leading to provably tight optimality gaps and, in some cases, global optimal soluutions. The convex relaxation is based on a few key ideas, including the introduction of flux direction variables, exact McCormick relaxations, on/off constraints, and integer cuts. Numerical experiments are conducted on the traditional Belgian gas network, as well as other real larger networks. The results demonstrate both the accuracy and computational speed of the relaxation and its ability to produce high-quality solutions.
△ Less
Submitted 23 June, 2015;
originally announced June 2015.
-
The QC Relaxation: Theoretical and Computational Results on Optimal Power Flow
Authors:
Carleton Coffrin,
Hassan L. Hijazi,
Pascal Van Hentenryck
Abstract:
Convex relaxations of the power flow equations and, in particular, the Semi-Definite Programming (SDP) and Second-Order Cone (SOC) relaxations, have attracted significant interest in recent years. The Quadratic Convex (QC) relaxation is a departure from these relaxations in the sense that it imposes constraints to preserve stronger links between the voltage variables through convex envelopes of th…
▽ More
Convex relaxations of the power flow equations and, in particular, the Semi-Definite Programming (SDP) and Second-Order Cone (SOC) relaxations, have attracted significant interest in recent years. The Quadratic Convex (QC) relaxation is a departure from these relaxations in the sense that it imposes constraints to preserve stronger links between the voltage variables through convex envelopes of the polar representation. This paper is a systematic study of the QC relaxation for AC Optimal Power Flow with realistic side constraints. The main theoretical result shows that the QC relaxation is stronger than the SOC relaxation and neither dominates nor is dominated by the SDP relaxation. In addition, comprehensive computational results show that the QC relaxation may produce significant improvements in accuracy over the SOC relaxation at a reasonable computational cost, especially for networks with tight bounds on phase angle differences. The QC and SOC relaxations are also shown to be significantly faster and reliable compared to the SDP relaxation given the current state of the respective solvers.
△ Less
Submitted 29 July, 2015; v1 submitted 27 February, 2015;
originally announced February 2015.