Questions tagged [manhattan]

21 questions
3
votes
0 answers

Why my algorithm doesn't work for manhattan skyline from codility

I'm doing training tasks from codility. I am done with StoneWall with 100/100 rate but I'm stuck with the main idea of Manhattan skyline problem in that task. The task is described here https://app.codility.com/programmers/task/stone_wall/ Well when…
Dron4K
  • 456
  • 2
  • 6
  • 20
1
vote
0 answers

Fastman R package: How can set a different cex for points to be highlighted?

I want to plot SNPs-based and k-mers-based gwas results in one Manhattan plot. I can highlight the k-mers-based associations in Manhattan plot. But at some locations, both are overlapping to each other and one type is hidden under another. If I can…
1
vote
1 answer

Change shape of the data point based on positive or negative value in ggplot2

I have the following dataset: beta pval Category_name 0.5 0.005 One -0.3 0.6 Two 0.2 0.03 Three -0.1 0.7 Four I am trying to make a figure using pval (y axis) and Category_name (x axis). I would like to use shape 24 when beta is positive, and shape…
kllrdr
  • 169
  • 8
1
vote
0 answers

Is 2 times weighted Manhattan distance still an admissible in N puzzle searching problem using A star?

I know Manhattan distance is an admissible heuristic function since it doesn't overestimate the cost of moving a tile to the correct location. But my question is If I double h, say scale up each of the weighted Manhattan distances by a factor of 2,…
user12684692
1
vote
0 answers

y-axis breaks with ggplot2 for a manhattan plot

I have a manhattan plot of genetic information: It was generated using the qqman package https://cran.r-project.org/web/packages/qqman/vignettes/qqman.html) in R which takes a dataframe of P-values, chromosome position and a gene position (for any…
tacrolimus
  • 500
  • 2
  • 12
1
vote
1 answer

OpenCL 1D range loop without knowledge of global size

I was wondering how can I iterate over a loop with a any number of work items (per group is irrelevant) I have 3 arrays and one of them is 2-dimensional(a matrix). The first array contains a set of integers. The matrix is filled with another set of…
Blackburn
  • 48
  • 4
1
vote
1 answer

Trapezoidal decomposition of polygon in C++

I'm dealing with a polygon "fracture" problem which is to decompose a polygon with (or without) holes into trapezoids. I've found something similar implemented in Python…
holmessh
  • 65
  • 5
1
vote
1 answer

Is there a way to select a subset of a Numpy 2D array using the Manhattan distance?

Say for example, I have a Numpy 2D array (7 rows, 7 columns) filled with zeros: my_ array = numpy.zeros((7, 7)) Then for sake of argument say that I want to select the element in the middle and set its value to 1: my_array[3,3] = 1 Now say that I…
1
vote
0 answers

Why does BFS always give Manhattan distance?

I was solving one question where we need to find the sum of Manhattan distances from a cell to all other given cells in a matrix. Now I am wondering why does BFS give Manhattan distance. Question: You are given an m x n grid grid of values 0, 1, or…
0
votes
1 answer

Displaying Median Rent Change YoY from 2021-2022 by Manhattan Neighborhood

I have been playing around with the Tableau Map functions and just noticed it was a built-in background layer displaying neighborhoods of the NYC boroughs. I got the idea of showing the YoY median percent change in rent by the Manhattan…
Mark
  • 11
  • 4
0
votes
1 answer

How to allow a max Manhattan distance between all the points in a group

I have a 2D-array in which I want to make groups where all the points in a group have a max Manhattan distance between them. The groups can be disjoint. For example, from this starting array (10 x 10): [[ 67 97 72 35 73 77 80 48 21 34] […
0
votes
1 answer

Difference between no. of moves with different heuristics solving N puzzle

I tried solving the N puzzle problem using the A* algorithm with the heuristics manhattan distance and number of misplaced tiles. Even though the heuristic no. of misplaced tiles took considerably longer time, the number of moves given by the two…
KavG
  • 169
  • 1
  • 12
0
votes
0 answers

Custom manhattan plot multi x-axis

I have the following data set gwas_data Running head -n 23 gwas_data gives me the following table. gwas_data <- data.frame( stringsAsFactors = FALSE, udi = c("A","B","C","D","E", …
zerberus
  • 73
  • 7
0
votes
1 answer

Manhattan Matrix by 2 Matrices is non symmetric but should be

I created two matrices that have random integers as components, the dimension of the matrix doesn't matter. Then I want to calculate the distance matrix by the Manhattan method and frame it as a matrix. The matrix should be symmetric, but when I…
ZZEEZZ
  • 3
  • 1
0
votes
1 answer

Is there any place in scikit-learn Lasso/Quantile Regression source code that L1 regularization is applied?

I could not find where the Manhattan distance of weights is calculated and multiplied with alpha (L1 reg. coefficient) in the Lasso Regression and the Quantile Regression source code of scikit-learn. I was trying to implement Lasso Regression and…
1
2